• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jsp include action: j2ee certificate.com question

 
Anupama Ponnapalli
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which of the following statements correctly declares an element that allows the output result of a specified resource to be inserted in a JSP page? [Check all correct answers]

1. <jsp:include file="disclaimer.html" />

2. <jsp:forward page="disclaimer.html" flush="true" />

3. <jsp:include page="disclaimer.html" flush="true" />

4. <%@ include file="disclaimer.html" %>

5. <jsp:forward page="disclaimer.html" />

Mock claims 3 & 5 as the correct answers. Could someone help me understand:

a) can a forward be considered the right option to "insert" content in a jsp
b) why is option 4 incorrect?

Thank you.
[ March 28, 2007: Message edited by: Anupama Ponnapalli ]
 
Sergio Tridente
Ranch Hand
Posts: 329
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Anupama Ponnapalli:
b) why is option 4 incorrect?


The 'include' page directive doesn't insert the output result of a specified resource in a JSP page: it just inserts that resource's code inside the JSP page before translation and compilation.
The key point here is in the word 'result'.
 
Anupama Ponnapalli
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for insight, Sergio. Sometimes, I feel like I am studying law

Any insight on the forward?
 
Muralidhar Adhikarla
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Option 5 should not have been correct , <jsp:forward > simply forwards the request to the Jsp page specified, so the results will be the resuls of the JSP page specified alone . Not sure y this option was right
 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good catch Sergio!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic