问题:单选题A developer is designing a multi-tier web application and discovers a need to hide the details of establishingand maintaining remote communications from the client. In addition, the application needs to find,in a transparent manner,the heterogeneous business components used to service the client’s requests. Which design patterns, working together, address these issues?()A Business Delegate and Transfer ObjectB Business Delegate and Service LocatorC Front Controller and Business DelegateD Intercepting Filter and Transfer Object
查看答案
问题:多选题For a given ServletResponse response,which two retrieve an object for writing text data?()Aresponse.getWriter()Bresponse.getOutputStream()Cresponse.getOutputWriter()Dresponse.getWriter().getOutputStream()Eresponse.getWriter(Writer.OUTPUT_TEXT)
问题:多选题For an HttpServletResponse response,which two create a custom header?()Aresponse.setHeader(X-MyHeader, 34);Bresponse.addHeader(X-MyHeader, 34);Cresponse.setHeader(new HttpHeader(X-MyHeader, 34));Dresponse.addHeader(new HttpHeader(X-MyHeader, 34));Eresponse.addHeader(new ServletHeader(X-MyHeader, 34));
问题:单选题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 **/ %>
问题:多选题A session-scoped attribute is stored by a servlet, and then that servlet forwards to a JSP page. Which threejsp:useBean attributes must be used to access this attribute in the JSP page?()AidBnameCbeanDtypeEscope
问题:多选题Which two are true about authentication?()AForm-based logins should NOT be used with HTTPS.BWhen using Basic Authentication the target server is NOT authenticated.CJ2EE compliant web containers are NOT required to support the HTTPS protocol.DWeb containers are required to support unauthenticated access to unprotected web resources.
问题:单选题Which interface must a class implement so that instances of the class are notified after any object is addedto a session?()A javax.servlet.http.HttpSessionListenerB javax.servlet.http.HttpSessionValueListenerC javax.servlet.http.HttpSessionBindingListenerD javax.servlet.http.HttpSessionAttributeListener
问题:单选题You have a use case in your web application that adds several session-scoped attributes. At the end of theuse case, one of these objects, the manager attribute, is removed and then it needs to decide which of theother session-scoped attributes to remove. How can this goal be accomplished?()A The object of the manager attribute should implement the HttpSessionBindingListener and it should call the removeAttribute method on the appropriate session attributes.B The object of the manager attribute should implement the HttpSessionListener and it should call the removeAttribute method on the appropriate session attributes.C The object of the manager attribute should implement the HttpSessionBindingListener and it should call the deleteAttribute method on the appropriate session attributes.D The object of the manager attribute should implement the HttpSessionListener and it should call the deleteAttribute method on the appropriate session attributes.
问题:单选题You have a new IT manager that has mandated that all JSPs must be refactored to include no scritpletcode. The IT manager has asked you to enforce this. Which deployment descriptor element will satisfy thisconstraint?()A <jsp-property-group>. <url-pattern>*.jsp</url-pattern>. <permit-scripting>false</permit-scripting>. </jsp-property-group>B <jsp-config>. <url-pattern>*.jsp</url-pattern><permit-scripting>false</permit-scripting>. </jsp-config>C <jsp-config>. <url-pattern>*.jsp</url-pattern>. <scripting-invalid>true</scripting-invalid>. </jsp-config>D <jsp-property-group>. <url-pattern>*.jsp</url-pattern>. <scripting-invalid>true</scripting-invalid>. </jsp-property-group>
问题:单选题The Squeaky Bean company has decided to port their web application to a new J2EE 1.4 container. Whilereviewing the application, a developer realizes that in multiple places within the current application, nearlyduplicate code exists that finds enterprise beans. Which pattern should be used to eliminate this duplicatecode?()A Transfer ObjectB Front ControllerC Service LocatorD Intercepting FilterE Business DelegateF Model-View-Controller
问题:单选题A developer is designing a web application that must verify for each request: The originating request is froma trusted network. The client has a valid session.The client has been authenticated. Which design pattern provides a solution in this situation?()A Transfer ObjectB Session FacadeC Intercepting FilterD Template MethodE Model-View-Controller
问题:多选题Given: 11. 15. Which three EL expressions, inserted at line 15,are valid and evaluate to "3"?()A${vals.2}B${vals[2]}C${vals.index}D${vals[index]}E${vals}[index]F${vals[vals[index-1]]}
问题:多选题Given: 3.class MyServlet extends HttpServlet { 4.public void doPut(HttpServletRequest req, HttpServletResponse resp) throws ServletException,IOException { 5.// servlet code here ... 26.} 27.} If the DD contains a single security constraint associated with MyServlet and its only tagsand tags are:GETPUT Admin Which four requests would be allowed by the container?()AA user whose role is Admin can perform a PUT.BA user whose role is Admin can perform a GET.CA user whose role is Admin can perform a POST.DA user whose role is Member can perform a PUT.EA user whose role is Member can perform a POST.FA user whose role is Member can perform a GET.
问题:多选题A web application allows the HTML title banner to be set using a servlet context initialization parametercalled titleStr. Which two properly set the title in this scenario?()A<title>${titleStr}</title>B<title>${initParam.titleStr}</title>C<title>${params[0].titleStr}</title>D<title>${paramValues.titleStr}</title>E<title>${initParam[’titleStr’]}</title>
问题:单选题A developer is designing a web application that makes many fine-grained remote data requests for eachclient request. During testing, the developer discovers that the volume of remote requests significantlydegrades performance of the application. Which design pattern provides a solution for this problem?()A FlyweightB Transfer ObjectC Service LocatorD Dispatcher ViewE Business DelegateF Model-View-Controller
问题:单选题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); %>
问题:单选题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);
问题:单选题Given a Filter class definition with this method: 21.public void doFilter(ServletRequest request, 22.ServletResponse response, 23.FilterChain chain) 24.throws ServletException, IOException { 25.// insert code here26. } Which should you insert at line 25 to properly invoke the next filter in the chain,or the target servlet if thereare no more filters?()A chain.forward(request, response);B chain.doFilter(request, response);C request.forward(request, response);D request.doFilter(request, response);
问题:单选题Given a Filter class definition with this method: 21.public void doFilter(ServletRequest request, 22.ServletResponse response, 23.FilterChain chain) 24.throws ServletException, IOException { 25.// insert code here 26.} Which should you insert at line 25 to properly invoke the next filter in the chain, or the target servlet if thereare no more filters?()A chain.forward(request, response);B chain.doFilter(request, response);C request.forward(request, response);D request.doFilter(request, response);
问题:单选题Which JSTL code snippet can be used to import content from another web resource?()A <c:import url=foo.jsp/>B <c:import page=foo.jsp/>C <c:include url=foo.jsp/>D <c:include page=foo.jsp/>