关于FilterChain的描述,哪一个正确()。A、如果不呼叫FilterChain的doFilter()方法,则请求略过接下来的过滤器而直接交给ServletB、如果有下一个过滤器,呼叫FilterChain的doFilter()方法,会将请求交给下一个过滤器C、如果没有下一个过滤器,呼叫FilterChain的doFilter()方法,会将请求交给ServletD、如果没有下一个过滤器,呼叫FilterChain的doFilter()方法没有作用

题目

关于FilterChain的描述,哪一个正确()。

  • A、如果不呼叫FilterChain的doFilter()方法,则请求略过接下来的过滤器而直接交给Servlet
  • B、如果有下一个过滤器,呼叫FilterChain的doFilter()方法,会将请求交给下一个过滤器
  • C、如果没有下一个过滤器,呼叫FilterChain的doFilter()方法,会将请求交给Servlet
  • D、如果没有下一个过滤器,呼叫FilterChain的doFilter()方法没有作用

相似考题
更多“关于FilterChain的描述,哪一个正确()。A、如果不呼叫FilterChain的doFilter()方法,则请求略过接下来的过滤器而直接交给ServletB、如果有下一个过滤器,呼叫FilterChain的doFilter()方法,会将请求交给下一个过滤器C、如果没有下一个过滤器,呼叫FilterChain的doFilter()方法,会将请求交给ServletD、如果没有下一个过滤器,呼叫FilterChain的doFilter()方法没有作用”相关问题
  • 第1题:

    关于用户来电接通后,马上断线的操作正确的是?()

    • A、接通后如果没有弹出用户信息,则直接置就绪,接下一个电话
    • B、接通后如果已弹出用户信息,直接置就绪,接下一个电话
    • C、接通后如果已弹出用户信息,则确认用户,按断线规范做记录
    • D、无论是否弹出信息,直接就绪,接下一个电话

    正确答案:A,C

  • 第2题:

    在编写过滤器时,需要完成的方法是()。

    • A、doFilter()
    • B、doChain()
    • C、doPost()
    • D、doDelete()

    正确答案:A

  • 第3题:

    在一个Filter中,处理filter的业务的是()方法 

    • A、dealFilter(ServletRequest reg,ServletResponse res,FilterChain chain)
    • B、dealFilter(ServletRequest reg,ServletResponse res)
    • C、doFilter(ServletRequest reg,ServletResponse res,FilterChain chain)
    • D、doFilter(ServletRequest reg,ServletResponse res)

    正确答案:C

  • 第4题:

    当用户在struts.xml文件中需要包含其它配置文件时,使用的元素是()

    • A、Action
    • B、Include
    • C、package
    • D、filterchain

    正确答案:B

  • 第5题:

    在Filter过滤器的生命周期方法中,每当传递请求或响应时,web容器会调用()方法。

    • A、init
    • B、service
    • C、doFilter
    • D、destroy

    正确答案:C

  • 第6题:

    在Java Web应用过滤器的生命周期方法中,每当传递请求或响应时,web容器会调用()方法。

    • A、init
    • B、service
    • C、doFilter
    • D、destroy

    正确答案:C

  • 第7题:

    有关过滤器init( )方法错误的是()。

    • A、每次调用过滤器时都会执行init方法
    • B、init方法可以访问FilterConfig对象。FilterConfig对象提供了对servlet环境及web.xml文件中指派的过滤器名的访问
    • C、利用init将FilterConfig对象存放在一个字段中,以便doFilter方法能够访问servlet环境或过滤器名
    • D、FilterConfig对象具有一个getInitParameter方法,它能够访问部署描述符文件(web.xml)中分配的过滤器的初始化参数

    正确答案:A

  • 第8题:

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

    • A、chain.forward(request, response);
    • B、chain.doFilter(request, response);
    • C、request.forward(request, response);
    • D、request.doFilter(request, response);

    正确答案:B

  • 第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,D

  • 第10题:

    多选题
    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
    解析: 暂无解析

  • 第11题:

    多选题
    关于过滤器的描述,以下哪一个正确()。
    A

    Filter接口定义了init()、service()与destroy()方法

    B

    会传入ServletRequest与ServletResponse至Filter

    C

    要执行下一个过滤器,必须执行FilterChaing的next()方法

    D

    如果要取得初始参数,要使用FilterConfig对象内容


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

  • 第12题:

    单选题
    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 here 26.} 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?()
    A

    chain.forward(request, response);

    B

    chain.doFilter(request, response);

    C

    request.forward(request, response);

    D

    request.doFilter(request, response);


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

  • 第13题:

    关于过滤器的描述,以下哪一个正确()。

    • A、Filter接口定义了init()、service()与destroy()方法
    • B、会传入ServletRequest与ServletResponse至Filter
    • C、要执行下一个过滤器,必须执行FilterChaing的next()方法
    • D、如果要取得初始参数,要使用FilterConfig对象内容

    正确答案:A,D

  • 第14题:

    下列说法正确的是()

    • A、Filter接口可以帮助我们在WEB应用中实施过滤技术
    • B、Filter接口拥有Init(FilterConfig filterConfig)方法
    • C、FilterChain是代码的过滤链,通过这个接口把过滤的任务在不同的Filter之间转移
    • D、FilterConfig接口代表了Filter的配置
    • E、FilterChain接口代表了Filter的配置

    正确答案:A,B,C,D

  • 第15题:

    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

  • 第16题:

    在一个Filter中,处理filter业务的是()方法。

    • A、dealFilter(ServletRequestrequest,ServletResponseresponse,FilterChainchain)
    • B、dealFilter(ServletRequestrequest,ServletResponseresponse)
    • C、doFilter(ServletRequestrequest,ServletResponseresponse,FilterChainchain)
    • D、doFilter(ServletRequestrequest,ServletResponseresponse)

    正确答案:C

  • 第17题:

    过滤器使用()才能继续传递到下一个过滤器。

    • A、request.getRequestDispatcher().forward(request,response)
    • B、doFilter()
    • C、doPut()
    • D、doChain()

    正确答案:B

  • 第18题:

    过滤器的生命周期可用它的三个方法表示,即()。

    • A、init()
    • B、doFilter()
    • C、service()
    • D、destroy()
    • E、Filter()

    正确答案:A,B,D

  • 第19题:

    如果过滤器发生堵塞现象,则过滤器进出口的温度是不同的。()


    正确答案:正确

  • 第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.

    正确答案:A,B,C

  • 第21题:

    单选题
    在一个Filter中,处理filter的业务的是()方法
    A

    dealFilter(ServletRequest reg,ServletResponse res,FilterChain chain)

    B

    dealFilter(ServletRequest reg,ServletResponse res)

    C

    doFilter(ServletRequest reg,ServletResponse res,FilterChain chain)

    D

    doFilter(ServletRequest reg,ServletResponse res)


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

  • 第22题:

    单选题
    过滤器使用()才能继续传递到下一个过滤器。
    A

    request.getRequestDispatcher().forward(request,response)

    B

    doFilter()

    C

    doPut()

    D

    doChain()


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

  • 第23题:

    多选题
    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
    解析: 暂无解析