Which JSP code snippet should be used in the template JSP to insert the JSP content for the body of the page?

You have built your own light-weight templating mechanism. Your servlets, which handle each
request, dispatch the request to one of a small set of template JSP pages. Each template JSP
controls the layout of the view by inserting the header, body, and footer elements into specific
locations within the template page. The URLs for these three elements are stored in requestscoped variables called, headerURL, bodyURL, and footerURL, respectively. These attribute
names are never used for other purposes. Which JSP code snippet should be used in the
template JSP to insert the JSP content for the body of the page?

You have built your own light-weight templating mechanism. Your servlets, which handle each
request, dispatch the request to one of a small set of template JSP pages. Each template JSP
controls the layout of the view by inserting the header, body, and footer elements into specific
locations within the template page. The URLs for these three elements are stored in requestscoped variables called, headerURL, bodyURL, and footerURL, respectively. These attribute
names are never used for other purposes. Which JSP code snippet should be used in the
template JSP to insert the JSP content for the body of the page?

A.
<jsp:insert page=’${bodyURL}’ />

B.
<jsp:insert file=’${bodyURL}’ />

C.
<jsp:include page=’${bodyURL}’ />

D.
<jsp:include file=’${bodyURL}’ />

E.
<jsp:insert page='<%= bodyURL %>’ />

F.
<jsp:include page='<%= bodyURL %>’ />

Explanation:



Leave a Reply 0

Your email address will not be published. Required fields are marked *