A JSP page needs to set the property of a given JavaBean to a value that is calculated with the JSP page. Which three jsp:setProperty attributes must be used to perform this initialization?()
A.Id B.Val C.Name D.Param E.Value F.Property
单项选择题Your web application uses a simple architecture in which servlets handle requests and then forward to aJSP using a request dispatcher. You need to pass information calculated by the servlet to the JSP;furthermore, that JSP uses a custom tag and must also process this information. This information mustNOT be accessible to any other servlet, JSP or session in the webapp. How can you accomplish this goal?()
A.Store the data in a public instance variable in the servlet. B.Add an attribute to the request object before using the request dispatcher. C.Add an attribute to the context object before using the request dispatcher. D.This CANNOT be done as the tag handler has no means to extract this data.
单项选择题Given the web application deployment descriptor elements: 11.<filter> 12.<filter-name>ParamAdder< filter-name> 13.<filter-class>com.example.ParamAdder< filter-class> 14.< filter>... 24.<filter-mapping> 25.<filter-name>ParamAdder< filter-name> 26.<servlet-name>MyServlet< servlet-name> 27.<!-- insert element here --> 28.< filter-mapping> Which element, inserted at line 27,causes the ParamAdder filter to be applied when MyServlet is invokedby another servlet using the RequestDispatcher.include method?()
A.<include/> B.<dispatcher>INCLUDE</dispatcher> C.<dispatcher>include</dispatcher> D.<filter-condition>INCLUDE</filter-condition> E.<filter-condition>include</filter-condition>
单项选择题Your web site has many user-customizable features, for example font and color preferences on web pages.Your IT department has already built a subsystem for user preferences using Java SE’s lang.util.prefspackage APIs and you have been ordered to reuse this subsystem in your web application. You need tocreate an event listener that stores the user’s Preference object when an HTTP session is created. Also,note that user identification information is stored in an HTTP cookie. Which partial listener class canaccomplish this goal?()
A. B. C. D.
单项选择题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 built a web application that you license to small businesses. The webapp uses a context parameter, called licenseExtension, which enables certain advanced features based on your client’s licensepackage. When a client pays for a specific service, you provide them with a license extension key that theyinsert into the of the deployment descriptor. Not every client will have this contextparameter so you need to create a context listener to set up a default value in the licenseExtensionparameter. Which code snippet will accomplish this goal?()