Win a copy of OCP Oracle Certified Professional Java SE 11 Developer Practice Tests this week in the OCP forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Ron McLeod
  • Tim Cooke
Sheriffs:
  • Devaka Cooray
  • paul wheaton
  • Mark Herschberg
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
  • Jj Roberts
Bartenders:
  • Carey Brown
  • salvin francis
  • Piet Souris

Including static content

 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Ranch Hand
Posts: 528
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ?
 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think the question is specifically looking for JSP Code. Not scripting.
 
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
but scripting is also part of JSP page
 
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Shantishri, I agreed with you. I hope that is the reason. Thanks everybody.
 
Ranch Hand
Posts: 517
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
is 2 correct answer?
 
Yati Tan
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
minu. 2 IS NOT RIGHT. ONLY 1 AND 3 ARE CORRECT.
reply
    Bookmark Topic Watch Topic
  • New Topic