问题:单选题What is the result?()AThe output is X = 6 y = 0BThe output is x = 7 y = 0CThe output is x = 6 y = -1DThe output is x = 7 y = -1ECompilation will fail.
查看答案
问题:单选题Which option prevents the exception thrown by my:errorProne from invoking the error page mechanism and outputs the message "File not found" in the response?()AABBCCDDEE
问题:单选题Which interface must a class implement to be informed of a session creation event?()Ajavax.servlet.http.HttpSessionListenerBjavax.servlet.http.HttpSessionBindingListenerCjavax.servlet.http.HttpSessionCreationListenerDjavax.servlet.http.HttpSessionActivationListener
问题:单选题} What is the result?()ACompilation succeeds and 1 is printed.BCompilation succeeds and 2 is printed.CAn error at line 8 causes compilation to fail.DAn error at line 14 causes compilation to fail.
问题:单选题Which thefollowingstatements about static inner classes is true?()AAn anonymous class can be declared as static.BA static inner class cannot be a static member of the outer class.CA static inner class does not require an instance of the enclosing class.DInstance member of a static inner class can be referenced using the class name of the staticinner class.
问题:多选题Which two HTTP methods are used to process from data in a servlet? ()Ado GETBdo PutCdo PostDdo TraceEdo SubmitFdo Process
问题:多选题A RequestDispatcher can be obtained from which two objects? ()AServletConfigBServletContextCHttpServletRequestDHttpServletResponse
问题:单选题Which the HTTP method represents a request for information about the supported methods on an HTTP server?()AGETBINFOCHEADDTRACEEOPTIONS
问题:单选题Which HTTP method has the characteristic that multiple indential requests may produce side effect beyond those of a single request()?APUTBGETCINFODPOSTEHEADFTRACE
问题:单选题A developer for the Company.com web site has been told that users may turn off cookie support in their browsers. What must the developer do to ensure that these customers can still use the web application?()AThe developer must ensure that every URL is properly encoded using the appropriate URL rewriting APIsBThe developer must provide an alternate mechanism for managing sessions and abandon theHttpSession mechanism entirelyCThe developer can ignore this issue. Web containers are required to support automatic URL rewriting when cookies are not supportedDThe developer must ass the string ?id= to the end of every URL to ensure that the conversion with the browser can continue.
问题:多选题For which three events can web application event listeners be registered? ()Awhen a session is createdBafter a servlet is destroyedCwhen a session has timed outDwhen a cookie has been createdEwhen a servlet has forwarded a requestFwhen a session attribute value is changed
问题:单选题Given an HttpServlet Request request and Http Servlet Response response, which sets a cookie “username” with the value “joe” in a servlet.?()Arequest.add Cookie (“username”. “joe”)Brequest.set Cookie (“username, “joe”)Cresponse.add Cookie (username”, “joe”))Drequest.add Header (new Cookie (“username”, “joe”))Erequest.add Cookie (new Cookie (“username”, “joe”))Fresponse.add Cookie (new Cookie (“username”, “joe”))Gresponse.add Header (new Cookie (“username”, “joe”))
问题:单选题Company.com has decided to use the FUBAR Application Server to host their web application. Unfortunately, the FUBAR Application Server uses the server machine’s file system for its JNDI namespace. Every JNDI lookup performed in the web application is translated into a file 1/0 operation, which results in very poor performance. Which J2EE pattern can help with this performance issue?()ATransfer ObjectBService LocatorCIntercepting FilterDModel-View-Controller
问题:单选题Which is the valid identifier?()AfalseBdefaultC_objectDa-class
问题:多选题Which two are characteristics of the Intercepting Filter pattern?()Ait provides centralized request handling for incoming requests.BIt forces resource authentication to be distributed across web components.CIt reduces coupling between presentation-tier clients and underlying business services.DIt can be added and removed unobtrusively, without requiring changes to existing code.EIt allows preprocessing and postprocessing on the incoming requests and outgoing responses.
问题:单选题Which is the true choice about the web container request processing model()?AThe init method on a filter is called the first time a servlet mapped to that filter is invokedBA filter defined for a servlet must always forward control to the next resource in the filter chain.CFilters associated with a named servlet are applied in the order they appear in the web application deployment descriptor fileDIf the init method on a filter throws an UnavailableException, then the container will make no further attempt to execute it
问题:多选题Which three logical expressions evaluate to true?()A(a = = c)B(d = = c)C(b = = d)D(a = = b)E(b = = c)F(d == 10.0)
问题:多选题A Company.com developer has created a web application that includes a servlet for each use case in the application. These servlets have become rather difficult to maintain because the request processing methods have become very large. There is also common processing code in many servlets because these use cases are very similar. Which two design patterns can be used together to refactor and simplify this web application? ()AProxyBView HelperCFront ControllerDSession FaçadeEBusiness DelegateFModel-View-Controller
问题:单选题A JSP page needs to perform some operations before servicing the first request. Where can this be done?()Awithin a method called jspInitBwithin the page directive of the JSP pageCwithin a scriptlet at the top of the JSP pageDwithin the XML element