Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Including static content

 
Yati Tan
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
Marcelo Ortega
Ranch Hand
Posts: 528
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see why 4 is incorrect.
The answers should be 1) 2) and 4).

Check the mock exam's errata.

Regards.
 
Yati Tan
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the question is specifically looking for JSP Code. Not scripting.
 
Bhavik Patel
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but scripting is also part of JSP page
 
shanthisri mocherla
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shantishri, I agreed with you. I hope that is the reason. Thanks everybody.
 
MInu
Ranch Hand
Posts: 517
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is 2 correct answer?
 
Yati Tan
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
minu. 2 IS NOT RIGHT. ONLY 1 AND 3 ARE CORRECT.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic