移动端

  • 题王微信公众号

    题王微信公众号

    微信搜“题王网”真题密题、最新资讯、考试攻略、轻松拿下考试

计算机考试 | Java认证考试

题库
练习
考试
资讯

模式切换

0 0 0
我的错题 我的收藏 学习笔记

章节目录

多选题 You want to create a filter for your web application and your filter will implement javax.servlet.Filter. Which two statements are true?()

A

Your filter class must implement an init method and a destroy method.

B

Your filter class must also implement javax.servlet.FilterChain.

C

When your filter chains to the next filter, it should pass the same arguments it received in its doFiltermethod.

D

The method that your filter invokes on the object it received that implements javax.servlet.FilterChaincan invoke either another filter or a servlet.

E

Your filter class must implement a doFilter method that takes, among other things, anHTTPServletRequest object and an HTTPServletResponse object.

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

单选题 For manageability purposes, you have been told to add a "count" instance variable to a critical JSP Document so that a JMX MBean can track how frequent this JSP is being invoked. Which JSP code snippetmust you use to declare this instance variable in the JSP Document?()

A

<jsp:declaration>int count = 0;<jsp:declaration>

B

<%! int count = 0; %>

C

<jsp:declaration.instance>int count = 0;. <jsp:declaration.instance>

D

<jsp:scriptlet.declaration>int count = 0;. <jsp:scriptlet.declaration>

多选题 Given: 11. 15. Which three EL expressions, inserted at line 15,are valid and evaluate to "3"?()

A

${vals.2}

B

${vals[2]}

C

${vals.index}

D

${vals[index]}

E

${vals}[index]

F

${vals[vals[index-1]]}

多选题 You need to store a Java long primitive attribute, called customerOID, into the session scope. Which two code snippets allow you to insert this value into the session?()

A

long customerOID = 47L;session.setAttribute(customerOID, new Long(customerOID));

B

long customerOID = 47L;session.setLongAttribute(customerOID, new Long(customerOID));

C

long customerOID = 47L;session.setAttribute(customerOID, customerOID);

D

long customerOID = 47L;session.setNumericAttribute(customerOID, new Long(customerOID));

首页 上一页 1 2 3 4 5 下一页 尾页 /

到第