• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

jsp include action: j2ee certificate.com question

 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 329
Oracle Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for insight, Sergio. Sometimes, I feel like I am studying law

Any insight on the forward?
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Good catch Sergio!
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic