SCDCD(310-081)

多选题Which two prevent a servlet from handling requests.?()AThe servlet’s init method returns a non-zero status.BThe servlet’s init method throws a Servlet ExceptionCThe servlet’s init method sets the Servlet Response’s context length to 0DThe servlet’s ini

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

如果没有搜索结果,请直接 联系老师 获取答案。
如果没有搜索结果,请直接 联系老师 获取答案。
相似问题和答案

第1题:

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

正确答案:B

第2题:

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

  • A、在Servlet实例化之后,Servlet容器会调用init()方法。
  • B、Servlet 通过init()方法可以实现一些初始化工作,如建立数据库连接,获取配置信息等
  • C、init()方法可以被多次调用

正确答案:C

第3题:

有关Servlet的生命周期说法正确的有()。

  • A、Servlet的生命周期由Servlet实例控制
  • B、init()方法在创建完Servlet实例后对其进行初始化,传递的参数为实现ServletContext接口的对象
  • C、service()方法响应客户端发出的请求
  • D、destroy()方法释放Servlet实例

正确答案:B,C,D

第4题:

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

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

正确答案:B

第5题:

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

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

正确答案:D

第6题:

Your IT department is building a lightweight Front Controller servlet that invokes an application logic objectwith the interface: public interface ApplicationController {public String invoke(HttpServletRequest request)} The return value of this method indicates a symbolic name of the next view. From this name, the FrontController servlet looks up the JSP URL in a configuration table. This URL might be an absolute path or apath relative to the current request. Next, the Front Controller servlet must send the request to this JSP togenerate the view. Assume that the servlet variable request is assigned the current HttpServletRequestobject and the variable context is assigned the webapp’s ServletContext. Which code snippet of the FrontController servlet accomplishes this goal?()

  • A、Dispatcher view=context.getDispatcher(viewURL);view.forward Request(request, response);
  • B、Dispatcher view=request.getDispatcher(viewURL);view.forward Request(request, response);
  • C、RequestDispatcher view. =context.getRequestDispatcher(viewURL);view.forward(request,response);
  • D、RequestDispatcher view=request.getRequestDispatcher(viewURL);view.forward(request, response);

正确答案:D

第7题:

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

第8题:

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.

正确答案:B,E

第9题:

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

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

正确答案:A

第10题:

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

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

正确答案:A,B,C

更多相关问题