多项选择题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.


您可能感兴趣的试卷

你可能感兴趣的试题

1.多项选择题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>

2.单项选择题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>

3.多项选择题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.

5.多项选择题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.

6.单项选择题

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);. }

7.多项选择题

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");

9.多项选择题

Click the Exhibit button.

A servlet sets a session-scoped attribute product with an instance of com.example.Product and forwards toa JSP.
Which two output the name of the product in the response?()

A.${product.name}
B.<jsp:getProperty name="product" property="name" />
C.<jsp:useBean id="com.example.Product" /><%= product.getName() %>
D.<jsp:getProperty name="product" class="com.example.Product" property="name" />

最新试题

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

题型:多项选择题

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

题型:单项选择题

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?

题型:单项选择题

A web application allows the HTML title banner to be set using a servlet context initialization parametercalled titleStr.Which two properly set the title in this scenario?()

题型:多项选择题

Which three are true about servlet filters?()

题型:多项选择题

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

题型:单项选择题

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

题型:单项选择题

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

题型:单项选择题

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

题型:问答题