单选题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
单选题
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
参考解析
解析:
暂无解析
相关考题:
在J2EE中,在Servlet1中的doGet和doPost方法中只有如下代码:request.setAttribute(jb,aptech);response.sendRedirect(http://localhost:8080/servlet/Servlet2);那么在Servlet2中使用()可以把属性jb的值取出来。 A.Stringstr=request.getAttribute(jb);B.Stringstr=(String)request.getAttribute(jb);C.Objectstr=request.getAttribute(jb);D.取不出来
ServletAforwardedarequesttoservletBusingtheforwardmethodofRequestDispatcher.WhatattributeinB’srequestobjectcontainstheURIoftheoriginalrequestreceivedbyservletA?() 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
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);
当属性scope的值为application时,JSP动作定义的JavaBean实例就会被存储到()对象中。A、Servlet ContextB、Http SessionC、Servlet ApplicationD、Http Servlet Request
在Servlet里,能实现跳转的方法有()。A、运用javax.servlet.http.HttpServletRequest接口的sendRedirect方法B、运用javax.servlet.http.HttpServletResponse接口的sendRedirect方法C、运用javax.servlet.RequestDispatcher接口的forward方法D、运用javax.servlet.ResponseDispatcher接口的forward方法
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 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.
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可通过由容器传递来的Http Servlet Request对象的()方法来获取客户请求的输入参数。A、getParameterB、getProtocolC、getContentTypeD、getAttribute
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
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.
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.
多选题在Servlet里,能实现跳转的方法有()。A运用javax.servlet.http.HttpServletRequest接口的sendRedirect方法B运用javax.servlet.http.HttpServletResponse接口的sendRedirect方法C运用javax.servlet.RequestDispatcher接口的forward方法D运用javax.servlet.ResponseDispatcher接口的forward方法
单选题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.
单选题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?()AHttpSessionBServletConfigCServletContextDHttpServletRequestEHttpServletResponse
单选题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?()Achain.forward(request, response);Bchain.doFilter(request, response);Crequest.forward(request, response);Drequest.doFilter(request, response);
单选题在J2EE中,在Servlet1中的doGet和doPost方法中只有如下代码: request.setAttribute("jb","aptech"); response.sendRedirect("http://localhost:8080/servlet/Servlet2"); 那么在Servlet2中使用()可以把属性jb的值取出来。AString str=request.getAttribute(jb);BString str=(String)request.getAttribute(jb);CObject str=request.getAttribute(jb);D取不出来
单选题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?()ADispatcher view=context.getDispatcher(viewURL);view.forward Request(request, response);BDispatcher view=request.getDispatcher(viewURL);view.forward Request(request, response);CRequestDispatcher view. =context.getRequestDispatcher(viewURL);view.forward(request,response);DRequestDispatcher view=request.getRequestDispatcher(viewURL);view.forward(request, response);
多选题For which three events can web application event listeners be registered? ()Awhen a session is createdBafter a servlet is destroyedCwhen a session has timed outDwhen a cookie has been createdEwhen a servlet has forwarded a requestFwhen a session attribute value is changed
单选题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
多选题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?()AAdd attributes to the session object.BAdd attributes on the request object.CAdd parameters to the request object.DUse the pageContext object to add request attributes.EAdd parameters to the JSP’s URL when generating the request dispatcher.
单选题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?()AStore the data in a public instance variable in the servlet.BAdd an attribute to the request object before using the request dispatcher.CAdd an attribute to the context object before using the request dispatcher.DThis CANNOT be done as the tag handler has no means to extract this data.
单选题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