Given the HTML form: 1. 2. 3. 4.Name: 5.Price: 6. 7. 8. 9. Assume the product attribute does NOT yet exist in any scope. Which code snippet, in submit.jsp,instantiates an instance of com.example.Product that contains the results of the form submission?()
A.
B.
C.
D.
您可能感興趣的試卷
你可能感興趣的試題
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>
最新試題
Click the ’Select and Place’ button.Place the events in the order they occur.
Which two are valid and equivalent?()
Click the 'Select and Place' button.Place the events in the order they occur.
In which three directories, relative to a web application’s root, may a tag library descriptor file reside whendeployed directly into a web application?()
A web browser need NOT always perform a complete request for a particular page that it suspects mightNOT have changed. The HTTP specification provides a mechanism for the browser to retrieve only a partialresponse from the web server; this response includes information, such as the Last-Modified date but NOTthe body of the page.Which HTTP method will the browser use to retrieve such a partial response?()
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.
Click the ’Select and Place’ button.Place the events in the order they occur.
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? ()