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

相关考题:

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

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_URIB、javax.servlet.forward.request_uriC、javax.servlet.forward.REQUEST_URID、javax.servlet.request_dispatcher.request_uriE、javax.servlet.request_dispatcher.REQUEST_URI

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);

下面哪个有关Servlet中init()操作的说法不正确的是:()A、在Servlet实例化之后,Servlet容器会调用init()方法。B、Servlet 通过init()方法可以实现一些初始化工作,如建立数据库连接,获取配置信息等C、init()方法可以被多次调用

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 invokedB、 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 fileD、 If the init method on a filter throws an UnavailableException, then the container will make no further attempt to execute it

当访问一个Servlet时,以下Servlet中的哪个方法先被执行?()A、destroy()B、doGet()C、service()D、init0

Servlet接受请求时,会调用()。A、serviceB、doGetC、doPostD、init

当访问一个Servlet时,Servlet中的方法执行顺序是()。 A、init() service() destroy()B、init() destroy() service()C、service() init() destroy()D、service() destroy() init()

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

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

Servlet的初始化参数只能在Servlet的()方法中获取。A、init()B、doPost()C、doGet()D、destroy()

用什么方法可以从一个HTTP会话中获得对象?()A、getAttribute method of javax.servlet.SessionB、getAttribute method of javax.servlet.http.HttpSessionC、getAttribute method of javax.servlet.http.SessionD、getAttribute methodof javax.servlet.HttpSession

Which two classes or interfaces provide a getSession method?()A、javax.servlet.http.HttpServletRequestB、javax.servlet.http.HttpSessionContextC、javax.servlet.http.HttpServletResponseD、javax.servlet.http.HttpSessionBindingEventE、javax.servlet.http.HttpSessionAttributeEvent

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.

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、 HttpSessionB、 ServletConfigC、 ServletContextD、 HttpServletRequestE、 HttpServletResponse

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.

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.

多选题Which three are true about servlet filters?()AA filter must implement the destroy method.BA filter must implement the doFilter method.CA servlet may have multiple filters associated with it.DA servlet that is to have a filter applied to it must implement the javax.servlet.FilterChain interface.EA filter that is part of a filter chain passes control to the next filter in the chain by invoking the FilterChain.forward method.

单选题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?()AREQUEST_URIBjavax.servlet.forward.request_uriCjavax.servlet.forward.REQUEST_URIDjavax.servlet.request_dispatcher.request_uriEjavax.servlet.request_dispatcher.REQUEST_URI

单选题Which is true about the web container request processing model?()AThe init method on a filter is called the first time a servlet mapped to that filter is invoked.BA filter defined for a servlet must always forward control to the next resource in the filter chain.CFilters associated with a named servlet are applied in the order they appear in the web application deployment descriptor file.DIf the init method on a filter throws an UnavailableException, then the container will make no further attempt to execute it.

多选题Which two classes or interfaces provide a getSession method?()Ajavax.servlet.http.HttpServletRequestBjavax.servlet.http.HttpSessionContextCjavax.servlet.http.HttpsServletResponseDjavax.servlet.http.HttpSessionBindingEventEjavax.servlet.http.HttpSessionAttributeEvent

多选题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 init method sets the Servlet Response’s content type to null.EThe servlet’s init method does NOT return within a time period defined by the servlet container.

单选题下面关于Servlet生命周期的描述不正确的是()。A Servlet实例由Servlet容器负责加载和创建B Servlet容器调用init()方法初始化Servlet,每加载一次Servlet都会执行一次init()方法C Servlet初始化完毕后,就处于能响应请求的就绪状态D Servlet的destroy()方法指明哪些资源可以被系统回收

单选题下面哪个有关Servlet中init()操作的说法不正确的是:()A在Servlet实例化之后,Servlet容器会调用init()方法。BServlet 通过init()方法可以实现一些初始化工作,如建立数据库连接,获取配置信息等Cinit()方法可以被多次调用

多选题关于servlet的init方法,说法正确的是()。A由servlet容器调用Bservlet容器只调用一次init方法来初始化一个servletC在servlet接受到客户请求前,init方法必须成功完成Dinit方法不能被覆盖(重写)

单选题当访问一个Servlet时,Servlet中的方法执行顺序是()。Ainit() service() destroy()Binit() destroy() service()Cservice() init() destroy()Dservice() destroy() init()

单选题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 HttpSessionB ServletConfigC ServletContextD HttpServletRequestE HttpServletResponse