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

题目

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.

相似考题
更多“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.”相关问题
  • 第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题:

    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

  • 第4题:

    Which version of a view would you use if you just want a quick, easy view within your XPage?()

    • A、Data Table Control
    • B、View Control
    • C、Repeat Control
    • D、Filter by category View Control

    正确答案:B

  • 第5题:

    Which 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.

    正确答案:A,B,C

  • 第6题:

    You have a firewall filter applied in an inbound direction on a customer interface. You would like this filter to protect your network from a spoofed denial of service attack. Which action should be configured to accomplish your goal?()

    • A、then reject
    • B、then discard
    • C、then next filter
    • D、then silent-drop

    正确答案:B

  • 第7题:

    You are developing an ASP.NET Dynamic Data Web application. Boolean fields must display as Yes or No instead of as a check box. You replace the markup in the default Boolean field template with the following markup.You need to implement the code that displays Yes or No. Which method of the FieldTemplateUserControl class should you override in the BooleanField class?()

    • A、OnLoad
    • B、Construct
    • C、OnDataBinding
    • D、SaveControlState

    正确答案:C

  • 第8题:

    You are developing a custom-collection class.You need to create a method in your class. You need to ensure that the method you create in your class returns a type that is compatible with the Foreach statement. Which criterion should the method meet?()

    • A、The method must return a type of either IEnumerator or IEnumerable.
    • B、The method must return a type of IComparable.
    • C、The method must explicitly contain a collection.
    • D、The method must be the only iterator in the class.

    正确答案:A

  • 第9题:

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


    正确答案: A,B
    解析: 暂无解析

  • 第10题:

    多选题
    You want to create a valid directory structure for your Java EE web application, and your application usestag files and a JAR file. Which three must be located directly in your WEB-INF directory(NOT in asubdirectory of WEB-INF)?()
    A

    The JAR file

    B

    A directory called lib

    C

    A directory called tags

    D

    A directory called TLDs

    E

    A directory called classes

    F

    A directory called META-INF


    正确答案: F,D
    解析: 暂无解析

  • 第11题:

    单选题
    You are developing a custom-collection class.You need to create a method in your class. You need to ensure that the method you create in your class returns a type that is compatible with the Foreach statement. Which criterion should the method meet?()
    A

    The method must return a type of either IEnumerator or IEnumerable.

    B

    The method must return a type of IComparable.

    C

    The method must explicitly contain a collection.

    D

    The method must be the only iterator in the class.


    正确答案: B
    解析: 暂无解析

  • 第12题:

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


    正确答案: A
    解析: 暂无解析

  • 第13题:

    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

  • 第14题:

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

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

    正确答案:A

  • 第15题:

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

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

    正确答案:A

  • 第16题:

    You want to create a valid directory structure for your Java EE web application, and your application usestag files and a JAR file. Which three must be located directly in your WEB-INF directory(NOT in asubdirectory of WEB-INF)?()

    • A、The JAR file
    • B、A directory called lib
    • C、A directory called tags
    • D、A directory called TLDs
    • E、A directory called classes
    • F、A directory called META-INF

    正确答案:B,C,E

  • 第17题:

    Which is true 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

  • 第18题:

    You have a firewall filter containing two terms applied in an inbound direction on a customer interface. You would like this filter to protect your network from a spoofed denial of service attack. What match criterion should be used in the first term of the filter?()

    • A、Source TCP port
    • B、Source IP address
    • C、Destination TCP port
    • D、Destination IP address

    正确答案:B

  • 第19题:

    You are developing a Web application to display products. Products are displayed on different pages on your Web site. You want to create a user control to manage the display of products. You need a default visual implementation of the UI of the user control. In addition, you need to provide developers with the flexibility to change the layout and controls of the UI. Which three actions should you perform? ()

    • A、Apply the TemplateContainerAttribute to a property of type ITemplate. Pass the type of the template's naming container as the argument to the attribute.
    • B、Apply the TemplateContainerAttribute to the user control's class declaration.
    • C、Implement a property of type INamingContainer in the user control's code-behind class.
    • D、Implement a property of type ITemplate in the user control's code-behind class.
    • E、Define a new class that inherits from the ITemplate interface. Implement the InstantiateIn method of the ITemplate interface.

    正确答案:A,D,E

  • 第20题:

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


    正确答案: E,A
    解析: 暂无解析

  • 第21题:

    单选题
    Which is true 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
    解析: 暂无解析

  • 第22题:

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


    正确答案: E,B
    解析: 暂无解析

  • 第23题:

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


    正确答案: C
    解析: 暂无解析