This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt in Final Mock Exam:HFSJ

 
Micheal John
Ranch Hand
Posts: 344
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From HFSJ: Final Mock Exam: Ques No:22 Page No:810


I thought of only A. But the answer given as A and C.
Actually <jsp:forward pade="/footer.html"/> is used to include the dynamic content only.. then how..?

My general doubt:
In which case option D will be true?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I thought of only A. But the answer given as A and C.
Actually <jsp:forward pade="/footer.html"/> is used to include the dynamic content only.. then how..?

A and C, not B. jsp:include allows to include both static and dynamic content.

About D, remember that the question is about JSP. D is not even scriptlet.
 
Paul Anilprem
Enthuware Software Support
Ranch Hand
Posts: 3760
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are two things:
1. Including dynamic content (i.e. by executing some code at the server side to generate new content as opposed to static content such as pure HTML pages).

JSP constructs such as scriptlets are used to generate dynamic content regardless of whether they are included statically or dynamically. A jsp page, whether included statically or dynamically can generate dynamic content. An HTML file, whether included statically or dynamically, can provide only static content.

2. Including content dynamically (i.e. at request time as opposed to statically i.e. compile time).
jsp:include (and jsp:forward) action is used to include content dynamically regardless of whether the content is static or dynamic.


If you want to include static content (which is what the question is asking), you can include it statically (option a) as well as dynamically (which the question has not specified) (option c).

I hope I didn't confuse you
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic