aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Including static content Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Including static content " Watch "Including static content " New topic
Author

Including static content

Yati Tan
Ranch Hand

Joined: May 28, 2005
Posts: 56
Which JSP code would include static content in a JSP ?

1) <%@ include file="/seg/footer.html" %>
2) <jsp:forward page="/seg/footer.html" />
3) <jsp:inlcude page="/seg/footer.html" />
4) RequestDispatcher dis =request.getRequestDispatcher("/seg/footer.html");
dis.include(request,response);

Answer to given ? is 1) and 3). Iam wondering why 4) is not valid answer ?

Pls help...


SCJP 1.4<br />SCJA 1.0<br />SCWCD 1.4
Marcelo Ortega
Ranch Hand

Joined: May 31, 2005
Posts: 519

I don't see why 4 is incorrect.
The answers should be 1) 2) and 4).

Check the mock exam's errata.

Regards.


SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCJD, SCEA/OCMJEA

Live life to an interface, not an implementation!
Yati Tan
Ranch Hand

Joined: May 28, 2005
Posts: 56
Marcelo,

I hv checked the errata. It doesnot says nything abt this question.

Please Bert, can you explain answer to this question ?
P Chittaranjan
Ranch Hand

Joined: Feb 09, 2006
Posts: 47
I think the question is specifically looking for JSP Code. Not scripting.


Thanks,<br />Chittaranjan<br />SCJP 5.0,SCWCD1.4,SCBCD 5
Bhavik Patel
Ranch Hand

Joined: Jul 12, 2004
Posts: 155
but scripting is also part of JSP page


SCJP 1.4<br />SCWCD 1.4(91%)<br />Working on SCJD -Bodgitt & Scrapper Constructions...<br /> <br />"It takes 43 muscles to frown & 17 to smile but it doen't take any to just sit there with a dumb look on your face .. Keep Smiling "
shanthisri mocherla
Ranch Hand

Joined: Sep 05, 2005
Posts: 119
Hi all
if the last option is within <% %>(scriptlet).Then it would be a correct option.But,here it is not enclosed with <% %>.That's why the last option is not a correct JSP code.

Hope I'm clear
Shanthi
Yati Tan
Ranch Hand

Joined: May 28, 2005
Posts: 56
Shantishri, I agreed with you. I hope that is the reason. Thanks everybody.
MInu
Ranch Hand

Joined: Oct 09, 2003
Posts: 517
is 2 correct answer?


God Gave Me Nothing I Wanted<br />He Gave Me Everything I Needed<br /> - Swami Vivekananda
Yati Tan
Ranch Hand

Joined: May 28, 2005
Posts: 56
minu. 2 IS NOT RIGHT. ONLY 1 AND 3 ARE CORRECT.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Including static content