多項選擇題

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 in the servlet to the JSP for view generation.This information must NOT be accessible to any other servlet,JSP or session in the webapp.
Which two techniques can you use to accomplish this goal?()

A.Add attributes to the session object.
B.Add attributes on the request object.
C.Add parameters to the request object.
D.Use the pageContext object to add request attributes.
E.Add parameters to the JSP’s URL when generating the request dispatcher.


您可能感興趣的試卷

你可能感興趣的試題

1.多項選擇題

A developer chooses to avoid using SingleThreadModel but wants to ensure that data is updated in athread-safe manner.
Which two can support this design goal?()

A.Store the data in a local variable.
B.Store the data in an instance variable.
C.Store the data in the HttpSession object.
D.Store the data in the ServletContext object.
E.Store the data in the ServletRequest object.

2.單項選擇題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"/>

4.多項選擇題

In a JSP-centric shopping cart application, you need to move a client’s home address of the Customerobject into the shipping address of the Order object. The address data is stored in a value object classcalled Address with properties for: street address, city, province, country, and postal code.
Which two JSPcode snippets can be used to accomplish this goal?()

A.<c:set var=’order’ property=’shipAddress’value=’${client.homeAddress}’ />
B.<c:set target=’${order}’ property=’shipAddress’value=’${client.homeAddress}’ />
C.<jsp:setProperty name=’${order}’ property=’shipAddress’ value=’${client.homeAddress}’ />
D.<c:set var=’order’ property=’shipAddress’><jsp:getProperty name=’client’ property=’homeAddress’ /> </c:store>
E.<c:set target=’${order}’ property=’shipAddress’><jsp:getProperty name=’client’ property=’homeAddress’ /> </c:set>

5.多項選擇題

A custom tag is defined to take three attributes.
Which two correctly invoke the tag within a JSP page?()

A.<prefix:myTag a="foo" b="bar" c="baz" />
B.<prefix:myTag attributes={"foo","bar","baz"} />
C.<prefix:myTag jsp:attribute a="foo" b="bar" c="baz" />
D.<prefix:myTag><jsp:attribute name="a">foo</jsp:attribute><jsp:attribute name="b">bar</jsp:attribute><jsp:attribute name="c">baz</jsp:attribute>. </prefix:myTag>

最新試題

Which is a benefit of precompiling a JSP page?()

題型:單項選擇題

Click the ’Select and Place’ button.Place the events in the order they occur.

題型:問答題

Given a web application in which the request parameter productID contains a product identifier.Which twoEL expressions evaluate the value of the productID?()

題型:多項選擇題

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?()

題型:單項選擇題

You are building a web application with a scheduling component. On the JSP, you need to show the currentdate, the date of the previous week, and the date of the next week. To help you present this information,you have created the following EL functions in the ’d’ namespace: name: curDate; signature: java.util.DatecurrentDate() name: addWeek; signature: java.util.Date addWeek(java.util.Date, int) name: dateString;signature:java.util.String getDateString(java.util.Date)Which EL code snippet will generate the string for the previousweek?

題型:單項選擇題

You need to create a JSP that generates some JavaScript code to populate an array of strings used on the client-side.Which JSP code snippet will create this array?()

題型:單項選擇題

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? ()

題型:多項選擇題

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.

題型:問答題

In which three directories, relative to a web application’s root, may a tag library descriptor file reside whendeployed directly into a web application?()

題型:多項選擇題