Page: 6
UNIT-6: The JavaServer Pages (JSP) Technology Model
Q15. The JSP developer wants a comment to be visible in the final output to the browser. Which comment style needs to be used in a JSP page? A. <!-- this is a comment --> B. <% // this is a comment %> C. <%-- this is a comment --%> D. <% /** this is a comment **/ %> Answer: A Q16. Which is a benefit of precompiling a JSP page? A. It avoids initialization on the first request. B. It provides the ability to debug runtime errors in the application. C. It provides better performance on the first request for the JSP page. D. It avoids execution of the _jspService method on the first request. Answer: C Q17. In a JSP-centric web application, you need to create a catalog browsing JSP page. The catalog is stored as a List object in the catalog attribute of the webapp's ServletContext object.Which scriptlet code snippet gives you access to the catalog object?
A. <% List catalog = config.getAttribute("catalog"); %> B. <% List catalog = context.getAttribute("catalog"); %> C. <% List catalog = application.getAttribute("catalog"); %> D. <% List catalog = servletContext.getAttribute("catalog"); %> Answer: C
Page: 6
1
2
3
4
5
6
7
8
9
10
|