Which two prevent a servlet from handling requests.?()A、 The servlet’s init method returns a non-zero status.B、 The servlet’s init method throws a Servlet ExceptionC、 The servlet’s init method sets the Servlet Response’s context length to 0D、 The servlet’

题目

Which two prevent a servlet from handling requests.?()

  • A、 The servlet’s init method returns a non-zero status.
  • B、 The servlet’s init method throws a Servlet Exception
  • C、 The servlet’s init method sets the Servlet Response’s context length to 0
  • D、 The servlet’s init method sets the Servlet Response’s content type to null.
  • E、 The servlet’s init method does NOT return within a time period defined by the servlet container.

相似考题
更多“Which two prevent a servlet from handling requests.?()A、 The servlet’s init method returns a non-zero status.B、 The servlet’s init method throws a Servlet ExceptionC、 The servlet’s init method sets the Servlet Response’s context length to 0D、 The servlet’”相关问题
  • 第1题:

    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

  • 第2题:

    Servlet接受请求时,会调用()。

    • A、service
    • B、doGet
    • C、doPost
    • D、init

    正确答案:A

  • 第3题:

    下面关于Servlet生命周期的描述不正确的是()。

    • A、 Servlet实例由Servlet容器负责加载和创建
    • B、 Servlet容器调用init()方法初始化Servlet,每加载一次Servlet都会执行一次init()方法
    • C、 Servlet初始化完毕后,就处于能响应请求的就绪状态
    • D、 Servlet的destroy()方法指明哪些资源可以被系统回收

    正确答案:B

  • 第4题:

    Servlet的初始化参数只能在Servlet的()方法中获取。

    • A、init()
    • B、doPost()
    • C、doGet()
    • D、destroy()

    正确答案:A

  • 第5题:

    Which two classes or interfaces provide a getSession method?()

    • A、javax.servlet.http.HttpServletRequest
    • B、javax.servlet.http.HttpSessionContext
    • C、javax.servlet.http.HttpServletResponse
    • D、javax.servlet.http.HttpSessionBindingEvent
    • E、javax.servlet.http.HttpSessionAttributeEvent

    正确答案:A,D

  • 第6题:

    Servlet A receives a request that it forwards to servlet B within another web application in the same web container. Servlet A needs to share data with servlet B and that data must not be visible to other servlets in A’s web application.  In which object can the data that A shares with B be stored?()

    • A、 HttpSession
    • B、 ServletConfig
    • C、 ServletContext
    • D、 HttpServletRequest
    • E、 HttpServletResponse

    正确答案:D

  • 第7题:

    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

  • 第8题:

    单选题
    Servlet A forwarded a request to servlet B using the forward method of RequestDispatcher. What attributein B’s request object contains the URI of the original request received by servlet A?()
    A

    REQUEST_URI

    B

    javax.servlet.forward.request_uri

    C

    javax.servlet.forward.REQUEST_URI

    D

    javax.servlet.request_dispatcher.request_uri

    E

    javax.servlet.request_dispatcher.REQUEST_URI


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

  • 第9题:

    多选题
    Which two classes or interfaces provide a getSession method?()
    A

    javax.servlet.http.HttpServletRequest

    B

    javax.servlet.http.HttpSessionContext

    C

    javax.servlet.http.HttpsServletResponse

    D

    javax.servlet.http.HttpSessionBindingEvent

    E

    javax.servlet.http.HttpSessionAttributeEvent


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

  • 第10题:

    单选题
    下面关于Servlet生命周期的描述不正确的是()。
    A

     Servlet实例由Servlet容器负责加载和创建

    B

     Servlet容器调用init()方法初始化Servlet,每加载一次Servlet都会执行一次init()方法

    C

     Servlet初始化完毕后,就处于能响应请求的就绪状态

    D

     Servlet的destroy()方法指明哪些资源可以被系统回收


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

  • 第11题:

    多选题
    关于servlet的init方法,说法正确的是()。
    A

    由servlet容器调用

    B

    servlet容器只调用一次init方法来初始化一个servlet

    C

    在servlet接受到客户请求前,init方法必须成功完成

    D

    init方法不能被覆盖(重写)


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

  • 第12题:

    单选题
    Servlet A receives a request that it forwards to servlet B within another web application in the same web container. Servlet A needs to share data with servlet B and that data must not be visible to other servlets in A’s web application.  In which object can the data that A shares with B be stored?()
    A

     HttpSession

    B

     ServletConfig

    C

     ServletContext

    D

     HttpServletRequest

    E

     HttpServletResponse


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

  • 第13题:

    当访问一个Servlet时,以下Servlet中的哪个方法先被执行?()

    • A、destroy()
    • B、doGet()
    • C、service()
    • D、init0

    正确答案:D

  • 第14题:

    当访问一个Servlet时,Servlet中的方法执行顺序是()。 

    • A、init() service() destroy()
    • B、init() destroy() service()
    • C、service() init() destroy()
    • D、service() destroy() init()

    正确答案:A

  • 第15题:

    关于servlet的init方法,说法正确的是()。

    • A、由servlet容器调用
    • B、servlet容器只调用一次init方法来初始化一个servlet
    • C、在servlet接受到客户请求前,init方法必须成功完成
    • D、init方法不能被覆盖(重写)

    正确答案:A,B,C

  • 第16题:

    用什么方法可以从一个HTTP会话中获得对象?()

    • A、getAttribute method of javax.servlet.Session
    • B、getAttribute method of javax.servlet.http.HttpSession
    • C、getAttribute method of javax.servlet.http.Session
    • D、getAttribute method of javax.servlet.HttpSession

    正确答案:B

  • 第17题:

    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

  • 第18题:

    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

  • 第19题:

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

  • 第20题:

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

  • 第21题:

    多选题
    Which two prevent a servlet from handling requests.?()
    A

    The servlet’s init method returns a non-zero status.

    B

    The servlet’s init method throws a Servlet Exception

    C

    The servlet’s init method sets the Servlet Response’s context length to 0

    D

    The servlet’s init method sets the Servlet Response’s content type to null.

    E

    The servlet’s init method does NOT return within a time period defined by the servlet container.


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

  • 第22题:

    单选题
    下面哪个有关Servlet中init()操作的说法不正确的是:()
    A

    在Servlet实例化之后,Servlet容器会调用init()方法。

    B

    Servlet 通过init()方法可以实现一些初始化工作,如建立数据库连接,获取配置信息等

    C

    init()方法可以被多次调用


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

  • 第23题:

    单选题
    当访问一个Servlet时,Servlet中的方法执行顺序是()。
    A

    init() service() destroy()

    B

    init() destroy() service()

    C

    service() init() destroy()

    D

    service() destroy() init()


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