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 ofthe 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 request scoped variables called, headerURL, bodyURL,and footerURL, respectively. These attribute names are never used for other purposes.
Which JSP codesnippet 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 %>’ />
您可能感興趣的試卷
你可能感興趣的試題
Click the Exhibit button.
A servlet sets a session-scoped attribute product with an instance of com.example.Product and forwards toa JSP.
Which two output the name of the product in the response?()
A.${product.name}
B.<jsp:getProperty name="product" property="name" />
C.<jsp:useBean id="com.example.Product" /><%= product.getName() %>
D.<jsp:getProperty name="product" class="com.example.Product" property="name" />
A session-scoped attribute, product, is stored by a servlet. That servlet then forwards to a JSP page. Thisattribute holds an instance of the com.example.Product class with a name property of "The Matrix" andprice property of 39.95. Given the JSP page code snippet: 1. 2.
A.Default costs 0.0
B.Default costs 49.95
C.Default costs 39.95
D.The Matrix costs 0.0
E.The Matrix costs 49.95
Given this fragment from a Java EE deployment descriptor:
341.<error-page>
342.<exception-type>java.lang.Throwable</exception-type>
343.<location>/mainError.jsp</location>
344.</error-page>
345.<error-page>
346.<exception-type>java.lang.ClassCastException</exception-type>
347.<location>/castError.jsp</location>
348.</error-page>
If the web application associated with the fragment above throws a ClassCastException.Which statement is true?()
A.The deployment descriptor is invalid.
B.The container invokes mainError.jsp.
C.The container invokes castError.jsp.
D.Neither mainError.jsp nor castError.jsp is invoked.
最新試題
Which ensures that a JSP response is of type "text/plain"?()
Click the ’Select and Place’ button.Place the events in the order they occur.
Your IT department is building a lightweight Front Controller servlet that invokes an application logic objectwith the interface:public interface ApplicationController {public String invoke(HttpServletRequest request)}The return value of this method indicates a symbolic name of the next view. From this name, the FrontController servlet looks up the JSP URL in a configuration table. This URL might be an absolute path or apath relative to the current request. Next, the Front Controller servlet must send the request to this JSP togenerate the view. Assume that the servlet variable request is assigned the current HttpServletRequestobject and the variable context is assigned the webapp’s ServletContext.Which code snippet of the FrontController servlet accomplishes this goal?()
Click the ’Select and Place’ button.Place the events in the order they occur.
You are building a dating service web site. Part of the form to submit a client’s profile is a groupIIof radio buttons for the person’s hobbies:20.<input type=’radio’ name=’hobbyEnum’ value=’HIKING’>Hiking <br>21.<input type=’radio’ name=’hobbyEnum’ value=’SKIING’>Skiing <br>22.<input type=’radio’ name=’hobbyEnum’ value=’SCUBA’>SCUBA Diving23.<!-- and more options -->After the user submits this form, a confirmation screen is displayed with these hobbies listed. Assume thatan application-scoped variable, hobbies, holds a map between the Hobby enumerated type and the displayname.Which EL code snippet will display Nth element of the user’s selected hobbies?()
Click the 'Select and Place' button.Place the events in the order they occur.
Click the ’Select and Place’ button.Place the events in the order they occur.
Which element of a web application deployment descriptor element is required?()
Click the ’Select and Place’ button.Place the events in the order they occur.
Given tutorial.jsp:2.EL Tutorial3.Example 14.5.Dear ${my:nickname(user)}6.Which, when added to the web application deployment descriptor,ensures that line 5 is included verbatimin the JSP output?()