A RequestDispatcher can be obtained from which two objects? ()A、 ServletConfigB、 ServletContextC、 HttpServletRequestD、 HttpServletResponse

题目

A RequestDispatcher can be obtained from which two objects? ()

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

相似考题
更多“A RequestDispatcher ”相关问题
  • 第1题:

    Servlet里能实现重定向的方法有() 

    • A、运用javax.serblet.http.HttpSerbletRequest接口的sendRedirect方法
    • B、运用javax.serblet.http.HttpSerbletResponse接口的sendRedirect方法
    • C、运用javax.serblet. RequestDispatcher接口的forward方法
    • D、运用javax.serblet.ResponseDispatcher接口的forward方法

    正确答案:B,C

  • 第2题:

    Servlet通过()可以实现请求转发机制。

    • A、HttpServletRequest接口
    • B、RequestDispatcher接口
    • C、HttpServletResponse接口
    • D、ServletConfig接口
    • E、Filter接口

    正确答案:B

  • 第3题:

    下列关于RequestDispatcher接口描述错误的是()

    • A、RequestDispatcher接口定义一个对象,该对象负责在服务器端接收来自客户端的请求并向他们发送资源
    • B、RequestDispatcher接口被Servlet引擎用来实现Http客户端和Http会话两者之间的关联
    • C、RequestDispatcher接口拥有forward()方法
    • D、RequestDispatcher接口拥有include()方法
    • E、RequestDispatcher接口的getId()方法返回会话ID--Servlet引擎设置的一个唯一关键字

    正确答案:E

  • 第4题:

    Requestdispatcher的forward方法和include方法的区别是forward可以到另外一个web应用的资源,而include只能到同一web的另外资源。


    正确答案:错误

  • 第5题:

    阅读下面代码片段: RequestDispatcher dispatcher=request.getRequestDispatcher("a.jsp"); dispatcher.forward(request,response); 关于该段代码的作用,下列叙述哪项是正确的?()

    • A、页面重定向到a.jsp页面
    • B、将请求转发到a.jsp页面
    • C、从a.jsp定向到当前页面
    • D、从a.jsp转发到当前页面

    正确答案:B

  • 第6题:

    单选题
    Given the web application deployment descriptor elements: 11. 12.ParamAdder 13.com.example.ParamAdder 14.... 24. 25.ParamAdder 26.MyServlet 27. 28. Which element, inserted at line 27,causes the ParamAdder filter to be applied when MyServlet is invokedby another servlet using the RequestDispatcher.include method?()
    A

    <include/>

    B

    <dispatcher>INCLUDE</dispatcher>

    C

    <dispatcher>include</dispatcher>

    D

    <filter-condition>INCLUDE</filter-condition>

    E

    <filter-condition>include</filter-condition>


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

  • 第7题:

    多选题
    A RequestDispatcher can be obtained from which two objects? ()
    A

    ServletConfig

    B

    ServletContext

    C

    HttpServletRequest

    D

    HttpServletResponse


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

  • 第8题:

    判断题
    Requestdispatcher的forward方法和include方法的区别是forward可以到另外一个web应用的资源,而include只能到同一web的另外资源。
    A

    B


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

  • 第9题:

    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

  • 第10题:

    下列说法正确的有()

    • A、forward方法请求转发的组件只能是同一个WEB应用中
    • B、RequestDispatcher对象指定的URL是相对于整个WEB站点的根目录
    • C、sendRedirect方法中的URL是相对于当前WEB应用程序的根目录
    • D、RequestDispatcher对象指定的URL是相对于当前WEB应用程序的根目录
    • E、sendRedirect方法中的URL是相对于整个WEB站点的根目录

    正确答案:A,D,E

  • 第11题:

    下面关于RequestDispatcher.forward()方法说法正确的是()

    • A、Servlet类使用RequestDispatcher.forward()方法来转发他所收到的HTTP请求
    • B、在调用forward()方法之前,不能有内容已经被实际输出到了客户端
    • C、该方法允许一个Servlet对一个请求作初步处理,而另一个资源将产生响应
    • D、该方法能包含服务器端的程序
    • E、以上都正确

    正确答案:A,B,C

  • 第12题:

    在Java EE中,以下对RequestDispatcher描述正确的是()。

    • A、JSP中有个隐含的对象dispatcher,它的类型是RequestDispatcher
    • B、ServletConfig有一个方法:getRequestDispatcher可以返回RequestDipatcher对象
    • C、RequestDipatcher有一个方法:forward可以把请求继续传递给别的Servlet或者JSP界面
    • D、JSP中有个隐含的默认对象request,它的类型是RequestDipatcher

    正确答案:C

  • 第13题:

    实现转发需要两个步骤,首先在Servlet中要得到RequestDispatcher对象,然后在调用该对象的forward方法实现转发。


    正确答案:正确

  • 第14题:

    单选题
    下列关于RequestDispatcher接口描述错误的是()
    A

    RequestDispatcher接口定义一个对象,该对象负责在服务器端接收来自客户端的请求并向他们发送资源

    B

    RequestDispatcher接口被Servlet引擎用来实现Http客户端和Http会话两者之间的关联

    C

    RequestDispatcher接口拥有forward()方法

    D

    RequestDispatcher接口拥有include()方法

    E

    RequestDispatcher接口的getId()方法返回会话ID--Servlet引擎设置的一个唯一关键字


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

  • 第15题:

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


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

  • 第16题:

    多选题
    Servlet里能实现重定向的方法有()
    A

    运用javax.serblet.http.HttpSerbletRequest接口的sendRedirect方法

    B

    运用javax.serblet.http.HttpSerbletResponse接口的sendRedirect方法

    C

    运用javax.serblet. RequestDispatcher接口的forward方法

    D

    运用javax.serblet.ResponseDispatcher接口的forward方法


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