单项选择题Which interface must a session attribute implement if it needs to be notified when a web container persistsa session?()

A.javax.servlet.http.HttpSessionListener
B.javax.servlet.http.HttpSessionBindingListener
C.javax.servlet.http.HttpSessionAttributeListener
D.javax.servlet.http.HttpSessionActivationListener


您可能感兴趣的试卷

你可能感兴趣的试题

3.多项选择题Which two statements are true about using the isUserInRole method to implement security in a Java EEapplication?()

A.It can be invoked only from the doGet or doPost methods.
B.It can be used independently of the getRemoteUser method.
C.Can return "true" even when its argument is NOT defined as a valid role name in the deployment descriptor.
D.Using the isUserInRole method overrides any declarative authentication related to the method in which it is invoked.

4.多项选择题Which two are required elements for the  element of a web applicationdeployment descriptor?()

A.<realm-name>
B.<url-pattern>
C.<description>
D.<web-resource-name>
E.<transport-guarantee>

5.单项选择题Which element of a web application deployment descriptor  element is required?()

A.<realm-name>
B.<auth-method>
C.<security-role>
D.<transport-guarantee>
E.<web-resource-collection>

6.多项选择题Which two statements are true about the security-related tags in a valid Java EE deployment descriptor?()

A.Every  tag must have at least one  tag.
B.A  tag can have many  tags.
C.A given  tag can apply to only one  tag.
D.A given  tag can contain from zero to many  tags.
E.It is possible to construct a valid  tag such that,for a given resource,no user rolescan access that resource.

8.多项选择题Which two are true concerning the objects available to developers creating tag files?()

A.The session object must be declared explicitly.
B.The request and response objects are available implicitly.
C.The output stream is available through the implicit outStream object.
D.The servlet context is available through the implicit servletContext object.
E.The JspContext for the tag file is available through the implicit jspContext object.

9.单项选择题

You are creating a content management system (CMS) with a web application front-end. The JSP thatdisplays a given document in the CMS has the following general structure:
1. <%-- tag declaration --%>
2. <t:document>
...
11. <t:paragraph>... <t:citation docID=’xyz’ /> ...</t:paragraph> ...
99. </t:document>
The citation tag must store information in the document tag for the document tag to generate a referencesection at the end of the generated web page. The document tag handler follows the Classic tag model andthe citation tag handler follows the Simple tag model. Furthermore, the citation tag could also be embeddedin other custom tags that could have either the Classic or Simple tag handler model.
Which tag handlermethod allows the citation tag to access the document tag?()

A.public void doTag() {JspTag docTag = findAncestorWithClass(this, DocumentTag.class); ((DocumentTag)docTag).addCitation(this.docID);}
B.public void doStartTag() {JspTag docTag = findAncestorWithClass(this, DocumentTag.class); ((DocumentTag)docTag).addCitation(this.docID);}
C.public void doTag() {. Tag docTag = findAncestor(this, DocumentTag.class); . ((DocumentTag)docTag).addCitation(this.docID);. }
D.public void doStartTag() {. Tag docTag = findAncestor(this, DocumentTag.class); . ((DocumentTag)docTag).addCitation(this.docID);. }

10.多项选择题

Given:
3.public class MyTagHandler extends TagSupport {
4.public int doStartTag() {
5.// insert code here
6.// return an int
7.}
8.// more code here
...
18.}
There is a single attribute foo in the session scope.
Which three code fragments,inserted independently atline 5,return the value of the attribute?()

A.Object o = pageContext.getAttribute("foo");
B.Object o = pageContext.findAttribute("foo");
C.Object o = pageContext.getAttribute("foo",PageContext.SESSION_SCOPE);
D.HttpSession s = pageContext.getSession();Object o = s.getAttribute("foo");

最新试题

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.

题型:问答题

All of your JSPs need to have a link that permits users to email the web master. This web application islicensed to many small businesses, each of which have a different email address for the web master. Youhave decided to use a context parameter that you specify in the deployment descriptor, like this:42.<context-param>43.<param-name>webmasterEmail</param-name>44.<param-value>master@example.com</param-value>45.</context-param>Which JSP code snippet creates this email link?()

题型:单项选择题

Given a Filter class definition with this method:21.public void doFilter(ServletRequest request,22.ServletResponse response,23.FilterChain chain)24.throws ServletException, IOException {25.// insert code here26.}Which should you insert at line 25 to properly invoke the next filter in the chain, or the target servlet if thereare no more filters?()

题型:单项选择题

Which two are valid and equivalent?()

题型:多项选择题

Click the Exhibit button.The attribute "name" has a value of "Foo,"What is the result if this tag handler’s tag is invoked?()

题型:单项选择题

Your company has a corporate policy that prohibits storing a customer’s credit card number in anycorporate database. However, users have complained that they do NOT want to re- enter their credit cardnumber for each transaction. Your management has decided to use client-side cookies to record the user’scredit card number for 120 days. Furthermore, they also want to protect this information during transit fromthe web browser to the web container; so the cookie must only be transmitted over HTTPS.Which codesnippet creates the "creditCard" cookie and adds it to the out going response to be stored on the user’s webbrowser?()

题型:单项选择题

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

题型:单项选择题

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.

题型:问答题