Hi Avseq,
p. 430 Question 12 is not asking anything about
include directive but only about
dynamic content in a JSP. Hence the explanation why Answer C and not Answer A which is given on p. 430 is correct.
For those who don't have the HFSJ book I put the question here:
QUESTION:
How would you include dynamic content in a JSP, similar to a server-side include (SSI)? (Choose all that apply)
A. <%@ include file="/segments/footer.jspf" %>
B. <jsp:forward page="/segments/footer.jspf"/>
C. <jsp:include page="/segments/footer.jspf"/>
D. RequestDispatcher dispatcher = request.getRequestDispatcher("/segments/footer.jspf"); dispatcher.include(request, response);
ANSWER: C
Option A is incorrect because it uses an include directive, which is for static includes that happen at translation time.
Regards,
Darya
[ September 05, 2005: Message edited by: Darya Akbari ]