SCWCD(310-083)

多选题You want to create a filter for your web application and your filter will implement javax.servlet.Filter. Which two statements are true?()AYour filter class must implement an init method and a destroy method.BYour filter class must also implement javax

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

参考答案和解析
正确答案: C,B
解析: 暂无解析
如果没有搜索结果,请直接 联系老师 获取答案。
相似问题和答案

第1题:

Your web application requires the adding and deleting of many session attributes during a complex usecase. A bug report has come in that indicates that an important session attribute is being deleted too soonand a NullPointerException is being thrown several interactions after the fact. You have decided to create asession event listener that will log when attributes are being deleted so you can track down when theattribute is erroneously being deleted. Which listener class will accomplish this debugging goal?()

  • A、Create an HttpSessionAttributeListener class and implement the attributeDeleted method and log the attribute name using the getName method on the event object.
  • B、Create an HttpSessionAttributeListener class and implement the attributeRemoved method and log the attribute name using the getName method on the event object.
  • C、Create an SessionAttributeListener class and implement the attributeRemoved method and log the attribute name using the getAttributeName method on the event object.
  • D、Create an SessionAttributeListener class and implement the attributeDeleted method and log the attribute name using the getAttributeName method on the event object.

正确答案:B

第2题:

In your web application,you need to execute a block of code whenever the session object is first created. Which design will accomplish this goal?()

  • A、Create an HttpSessionListener class and implement the sessionInitialized method with that block ofcode.
  • B、Create an HttpSessionActivationListener class and implement the sessionCreated method with thatblock of code.
  • C、Create a Filter class, call the getSession(false) method, and if the result was null, then execute that block of code.
  • D、Create an HttpSessionListener class and implement the sessionCreated method with that block of code.

正确答案:D

第3题:

Given a class whose instances, when found in a collection of objects, are sorted by using the compareTo()method, which two statements are true?()

A.The class implements java.lang.Comparable.

B.The class implements java.util.Comparator.

C.The interface used to implement sorting allows this class to define only one sort sequence.

D.The interface used to implement sorting allows this class to define many different sort sequences.


参考答案:A, C

第4题:

Given a class whose instances, when found in a collection of objects, are sorted by using the compareTo() method, which two statements are true?()

  • A、The class implements java.lang.Comparable.
  • B、The class implements java.util.Comparator.
  • C、The interface used to implement sorting allows this class to define only one sort sequence.
  • D、The interface used to implement sorting allows this class to define many different sort sequences.

正确答案:A,C

第5题:

Which is the true choice about the web container request processing model()?

  • A、 The init method on a filter is called the first time a servlet mapped to that filter is invoked
  • B、 A filter defined for a servlet must always forward control to the next resource in the filter chain.
  • C、 Filters associated with a named servlet are applied in the order they appear in the web application deployment descriptor file
  • D、 If the init method on a filter throws an UnavailableException, then the container will make no further attempt to execute it

正确答案:C

第6题:

Which the three are true about servlet filters?()

  • A、 A filter must implement the destroy method
  • B、 A filter must implement the doFilter method
  • C、 A servlet may have multiple filters associated with it
  • D、 A servlet that is to have a filter applied to it must implement the javax.servlet.FilterChain  interface
  • E、 A filter that is part of a filter chain passes control to the next filter in the chain by invoking the filterChain forward method
  • F、 For each  element in the web application deployment descriptor, multiple instances of a filter may be created by the web container

正确答案:A,B,C

第7题:

在J2EE中使用Servlet过滤器时,可以在web.xml文件的()元素中包括<init-param>元素。

  • A、<filter>
  • B、<filter-mapping>
  • C、<filter-name>
  • D、<filter-class>

正确答案:A

第8题:

A custom JSP tag must be able to support an arbitrary number of attributes whose names are unknown when the tag class is designed.  Which two are true? ()

  • A、 A  element in the echo tag LTD must have the value JSP
  • B、 The echo tag handler must define the setAttribute (String key, String value) method
  • C、 The true element must appear in the echo tag TLD
  • D、 The class implementing the echo tag handler must implement the javax.sevlet.jsp.tagext.IterationTag interface
  • E、 The class implementing the echo tag handler must implement the javax.sevlet.jsp.tagext.DynamicAttributes interface

正确答案:C,E

第9题:

在JAVA EE中,使用Servlet过滤器时,可以在web.xml文件的()元素中包括〈init-param〉元素。

  • A、〈filter〉
  • B、〈filter-mapping〉
  • C、〈filter-name〉
  • D、〈filter-class〉

正确答案:A

第10题:

A developer wants too use EL to invoke a function using S{my:bloof(“foof”)}. Which is always true?()

  • A、 The method invoked by this function must be statie.
  • B、 The function class must implement the Function interface.
  • C、 The expression is NOT a valid EL expression for invoking a function.
  • D、 The function must be declared in a web.xml file using the  element.
  • E、 The function class must have a method with the signature:Void bloof (java.lang.Strings)

正确答案:A

更多相关问题