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.
您可能感興趣的試卷
你可能感興趣的試題
A.<c:import url="foo.jsp"/>
B.<c:import page="foo.jsp"/>
C.<c:include url="foo.jsp"/>
D.<c:include page="foo.jsp"/>
You have been contracted to create a web site for a free dating service. One feature is the ability for oneclient to send a message to another client, which is displayed in the latter client’s private page. Your contract explicitly states that security is a high priority. Therefore, you need to prevent cross-site hacking inwhich one user inserts JavaScript code that is then rendered and invoked when another user views thatcontent.
Which two JSTL code snippets will prevent cross site hacking in the scenario above? ()
A.<c:out>${message}</c:out>
B.<c:out value=’${message}’ />
C.<c:out value=’${message}’ escapeXml=’true’ />
D.<c:out eliminateXml=’true’>${message}</c:out>
E.<c:out value=’${message}’ eliminateXml=’true’ />
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>
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>
You are developing several tag libraries that will be sold for development of third-party web applications.You are about to publish the first three libraries as JAR files: container-tags.jar,advanced-html-form-tags.jar, and basic-html-form-tags.jar.
Which two techniques are appropriate for packaging the TLD files forthese tag libraries?()
A.The TLD must be located within the WEB-INF directory of the JAR file.
B.The TLD must be located within the META-INF directory of the JAR file.
C.The TLD must be located within the META-INF/tld/ directory of the JAR file.
D.The TLD must be located within a subdirectory of WEB-INF directory of the JAR file.
E.The TLD must be located within a subdirectory of META-INF directory of the JAR file.
最新試題
Click the Exhibit button.The attribute "name" has a value of "Foo,"What is the result if this tag handler’s tag is invoked?()
Click the ’Select and Place’ button.Place the events in the order they occur.
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?()
In which three directories, relative to a web application’s root, may a tag library descriptor file reside whendeployed directly into a web application?()
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?
Which three are true about servlet filters?()
Which is true about the web container request processing model?()
Given tutorial.jsp:2.EL Tutorial3.Example 14.5.Dear ${my:nickname(user)}6.Which, when added to the web application deployment descriptor,ensures that line 5 is included verbatimin the JSP output?()
You are building a dating service web site. Part of the form to submit a client’s profile is a groupIIof radio buttons for the person’s hobbies:20.<input type=’radio’ name=’hobbyEnum’ value=’HIKING’>Hiking <br>21.<input type=’radio’ name=’hobbyEnum’ value=’SKIING’>Skiing <br>22.<input type=’radio’ name=’hobbyEnum’ value=’SCUBA’>SCUBA Diving23.<!-- and more options -->After the user submits this form, a confirmation screen is displayed with these hobbies listed. Assume thatan application-scoped variable, hobbies, holds a map between the Hobby enumerated type and the displayname.Which EL code snippet will display Nth element of the user’s selected hobbies?()
Click the 'Select and Place' button.Place the events in the order they occur.