单项选择题

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?()

A.Dispatcher view=context.getDispatcher(viewURL);view.forward Request(request, response);
B.Dispatcher view=request.getDispatcher(viewURL);view.forward Request(request, response);
C.RequestDispatcher view. =context.getRequestDispatcher(viewURL);view.forward(request,response);
D.RequestDispatcher view=request.getRequestDispatcher(viewURL);view.forward(request, response);


您可能感兴趣的试卷

你可能感兴趣的试题

1.单项选择题Which is true about the web container request processing model?()

A.The init method on a filter is called the first time a servlet mapped to that filter is invoked.
B.A filter defined for a servlet must always forward control to the next resource in the filter chain.
C.Filters associated with a named servlet are applied in the order they appear in the web application deployment descriptor file.
D.If the init method on a filter throws an UnavailableException, then the container will make no further attempt to execute it.

2.多项选择题Which three are true about servlet filters?()

A.A filter must implement the destroy method.
B.A filter must implement the doFilter method.
C.A servlet may have multiple filters associated with it.
D.A servlet that is to have a filter applied to it must implement the javax.servlet.FilterChain interface.
E.A filter that is part of a filter chain passes control to the next filter in the chain by invoking the FilterChain.forward method.

4.单项选择题Which ensures that a JSP response is of type "text/plain"?()

A.<%@ page mimeType="text/plain" %>
B.<%@ page contentType="text/plain" %>
C.<%@ page pageEncoding="text/plain" %>
D.<%@ page contentEncoding="text/plain" %>
E.<% response.setEncoding("text/plain"); %>

5.单项选择题

You are building your own layout mechanism by including dynamic content for the page’s header and footersections. The footer is always static, but the header generates the <title> tag that requires the page name tobe specified dynamically when the header is imported.
Which JSP code snippet performs the import of theheader content?()

 

A.<jsp:include page=’/WEB-INF/jsp/header.jsp’><jsp:param name=’pageName’ value=’Welcome Page’ /> </jsp:include>
B.<jsp:import page=’/WEB-INF/jsp/header.jsp’><jsp:param name=’pageName’ value=’Welcome Page’ /> </jsp:import>
C.<jsp:include page=’/WEB-INF/jsp/header.jsp’><jsp:attribute name=’pageName’ value=’Welcome Page’ /> . </jsp:include>
D.<jsp:import page=’/WEB-INF/jsp/header.jsp’>. <jsp:attribute name=’pageName’ value=’Welcome Page’ /> . </jsp:import>

7.单项选择题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.

8.单项选择题

The JSP developer wants a comment to be visible in the final output to the browser.
Which comment styleneeds 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 **/ %>

9.多项选择题Which two are valid and equivalent?()

A.<%! int i; %>
B.<%= int i; %>
C.<jsp:expr>int i;</jsp:expr>
D.<jsp:scriptlet>int i;</jsp:scriptlet>
E.<jsp:declaration>int i;</jsp:declaration>

最新试题

Click the ’Select and Place’ button.Place the events in the order they occur.

题型:问答题

You are building a web application with a scheduling component. On the JSP, you need to show the currentdate, the date of the previous week, and the date of the next week. To help you present this information,you have created the following EL functions in the ’d’ namespace: name: curDate; signature: java.util.DatecurrentDate() name: addWeek; signature: java.util.Date addWeek(java.util.Date, int) name: dateString;signature:java.util.String getDateString(java.util.Date)Which EL code snippet will generate the string for the previousweek?

题型:单项选择题

You are building a dating web site. The client’s date of birth is collected along with lots of other information.The Person class has a derived method, getAge():int, which returns the person’s age calculated from thedate of birth and today’s date. In one of your JSPs you need to print a special message to clients within theage group of 25 through 35.Which two EL code snippets will return true for this condition? ()

题型:多项选择题

Click the Exhibit button.The attribute "name" has a value of "Foo,"What is the result if this tag handler’s tag is invoked?()

题型:单项选择题

Which is true about the web container request processing model?()

题型:单项选择题

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?()

题型:单项选择题

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.

题型:问答题

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.

题型:问答题