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

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


相似考题
更多“单选题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.servl”相关问题
  • 第1题:

    Given an HttpServlet Request request and Http Servlet Response response, which sets a cookie “username” with the value “joe” in a servlet.?()

    • A、 request.add Cookie (“username”. “joe”)
    • B、 request.set Cookie (“username, “joe”)
    • C、 response.add Cookie (username”, “joe”))
    • D、 request.add Header (new Cookie (“username”, “joe”))
    • E、 request.add Cookie (new Cookie (“username”, “joe”))
    • F、 response.add Cookie (new Cookie (“username”, “joe”))
    • G、 response.add Header (new Cookie (“username”, “joe”))

    正确答案:F

  • 第2题:

    Your web application uses a simple architecture in which servlets handle requests and then forward to aJSP using a request dispatcher. You need to pass information calculated by the servlet to the JSP;furthermore, that JSP uses a custom tag and must also process this information. This information mustNOT be accessible to any other servlet, JSP or session in the webapp. How can you accomplish this goal?()

    • A、Store the data in a public instance variable in the servlet.
    • B、Add an attribute to the request object before using the request dispatcher.
    • C、Add an attribute to the context object before using the request dispatcher.
    • D、This CANNOT be done as the tag handler has no means to extract this data.

    正确答案:B

  • 第3题:

    Servlet的事件驱动由()实现。

    • A、Filter
    • B、Listener
    • C、Response
    • D、Request

    正确答案:B

  • 第4题:

    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

  • 第5题:

    Your web application uses a simple architecture in which servlets handle requests and then forward to aJSP using a request dispatcher. You need to pass information calculated in the servlet to the JSP for view generation.This information must NOT be accessible to any other servlet,JSP or session in the webapp. Which two techniques can you use to accomplish this goal?()

    • A、Add attributes to the session object.
    • B、Add attributes on the request object.
    • C、Add parameters to the request object.
    • D、Use the pageContext object to add request attributes.
    • E、Add parameters to the JSP’s URL when generating the request dispatcher.

    正确答案:B,E

  • 第6题:

    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

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


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

  • 第8题:

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

  • 第9题:

    单选题
    在J2EE中,在Servlet1中的doGet和doPost方法中只有如下代码:  request.setAttribute("jb","aptech");  response.sendRedirect("http://localhost:8080/servlet/Servlet2");  那么在Servlet2中使用()可以把属性jb的值取出来。
    A

    String str=request.getAttribute(jb);

    B

    String str=(String)request.getAttribute(jb);

    C

    Object str=request.getAttribute(jb);

    D

    取不出来


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

  • 第10题:

    单选题
    Servlet A receives a request that it forwards to servlet B within another web application in the same webcontainer. Servlet A needs to share data with servlet B and that data must not be visible to other servlets inA’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


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

  • 第11题:

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

  • 第12题:

    单选题
    Given an HttpServlet Request request and Http Servlet Response response, which sets a cookie “username” with the value “joe” in a servlet.?()
    A

     request.add Cookie (“username”. “joe”)

    B

     request.set Cookie (“username, “joe”)

    C

     response.add Cookie (username”, “joe”))

    D

     request.add Header (new Cookie (“username”, “joe”))

    E

     request.add Cookie (new Cookie (“username”, “joe”))

    F

     response.add Cookie (new Cookie (“username”, “joe”))

    G

     response.add Header (new Cookie (“username”, “joe”))


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

  • 第13题:

    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

  • 第14题:

    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

  • 第15题:

    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

  • 第16题:

    A developer has created a special servlet that is responsible for generating XML content that is sent to adata warehousing subsystem. This subsystem uses HTTP to request these large data files, which are compressed by the servlet to save internal network bandwidth. The developer has received a request frommanagement to create several more of these data warehousing servlets. The developer is about to copyand paste the compression code into each new servlet. Which design pattern can consolidate thiscompression code to be used by all of the data warehousing servlets?()

    • A、Facade
    • B、View Helper
    • C、Transfer Object
    • D、Intercepting Filter
    • E、Composite Facade

    正确答案:D

  • 第17题:

    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

  • 第18题:

    单选题
    Your web application uses a simple architecture in which servlets handle requests and then forward to aJSP using a request dispatcher. You need to pass information calculated by the servlet to the JSP;furthermore, that JSP uses a custom tag and must also process this information. This information mustNOT be accessible to any other servlet, JSP or session in the webapp. How can you accomplish this goal?()
    A

    Store the data in a public instance variable in the servlet.

    B

    Add an attribute to the request object before using the request dispatcher.

    C

    Add an attribute to the context object before using the request dispatcher.

    D

    This CANNOT be done as the tag handler has no means to extract this data.


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

  • 第19题:

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

  • 第20题:

    单选题
    A developer has created a special servlet that is responsible for generating XML content that is sent to adata warehousing subsystem. This subsystem uses HTTP to request these large data files, which are compressed by the servlet to save internal network bandwidth. The developer has received a request frommanagement to create several more of these data warehousing servlets. The developer is about to copyand paste the compression code into each new servlet. Which design pattern can consolidate thiscompression code to be used by all of the data warehousing servlets?()
    A

    Facade

    B

    View Helper

    C

    Transfer Object

    D

    Intercepting Filter

    E

    Composite Facade


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

  • 第21题:

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


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

  • 第22题:

    多选题
    Your web application uses a simple architecture in which servlets handle requests and then forward to aJSP using a request dispatcher. You need to pass information calculated in the servlet to the JSP for view generation.This information must NOT be accessible to any other servlet,JSP or session in the webapp. Which two techniques can you use to accomplish this goal?()
    A

    Add attributes to the session object.

    B

    Add attributes on the request object.

    C

    Add parameters to the request object.

    D

    Use the pageContext object to add request attributes.

    E

    Add parameters to the JSP’s URL when generating the request dispatcher.


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

  • 第23题:

    单选题
    Which retrieves the binary input stream on line 13?()
    A

     request.get Writer ():

    B

     request.get Reader ():

    C

     request.get Input Stream():

    D

     request.get Resource As Stream():

    E

     request.get Resource As Stream (Servlet Request. REQUEST):


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

  • 第24题:

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