This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
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);
D (wrong): Option D would be correct if it was a scriplet: it functionality does the same thing as option C, but its syntax is only used in servlets.
Does it mean that the only reason why option D isn't correct is that there're no <% %> around this code?..