A JSP page needs to instantiate a JavaBean to be used by only that page. Which two jsp:useBeanattributes must be used to access this attribute in the JSP page?()
A.Id B.Type C.Name D.Class E.Yscope
单项选择题Your web application views all have the same header, which includes the <title> tag in the <head> elementof the rendered HTML. You have decided to remove this redundant HTML code from your JSPs and put itinto a single JSP called WEB-INF jsp header.jsp. However, the title of each page is unique, so you havedecided to use a variable called pageTitle to parameterize this in the header JSP, like this: 10.<title>${param.pageTitle}<title> Which JSP code snippet should you use in your main view JSPs to insert the header and pass thepageTitle variable?()
A.<jsp:insert page=’/WEB-INF/jsp/header.jsp’>. ${pageTitle=’Welcome Page’}. </jsp:insert> B.<jsp:include page=’/WEB-INF/jsp/header.jsp’>. ${pageTitle=’Welcome Page’}. </jsp:include> C.<jsp:include file=’/WEB-INF/jsp/header.jsp’>. ${pageTitle=’Welcome Page’}. </jsp:include> D.<jsp:insert page=’/WEB-INF/jsp/header.jsp’>. <jsp:param name=’pageTitle’ value=’Welcome Page’ /> . </jsp:insert> E.<jsp:include page=’/WEB-INF/jsp/header.jsp’>. <jsp:param name=’pageTitle’ value=’Welcome Page’ /> . </jsp:include>
多项选择题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.