REQUEST_URI
javax.servlet.forward.request_uri
javax.servlet.forward.REQUEST_URI
javax.servlet.request_dispatcher.request_uri
javax.servlet.request_dispatcher.REQUEST_URI
第1题:
Given an HttpServlet Request request and Http Servlet Response response, which sets a cookie “username” with the value “joe” in a servlet.?()
第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?()
第3题:
Servlet的事件驱动由()实现。
第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?()
第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?()
第6题:
Which is true about the web container request processing model?()
第7题:
The init method on a filter is called the first time a servlet mapped to that filter is invoked
A filter defined for a servlet must always forward control to the next resource in the filter chain.
Filters associated with a named servlet are applied in the order they appear in the web application deployment descriptor file
If the init method on a filter throws an UnavailableException, then the container will make no further attempt to execute it
第8题:
The init method on a filter is called the first time a servlet mapped to that filter is invoked.
A filter defined for a servlet must always forward control to the next resource in the filter chain.
Filters associated with a named servlet are applied in the order they appear in the web application deployment descriptor file.
If the init method on a filter throws an UnavailableException, then the container will make no further attempt to execute it.
第9题:
String str=request.getAttribute(jb);
String str=(String)request.getAttribute(jb);
Object str=request.getAttribute(jb);
取不出来
第10题:
HttpSession
ServletConfig
ServletContext
HttpServletRequest
HttpServletResponse
第11题:
HttpSession
ServletConfig
ServletContext
HttpServletRequest
HttpServletResponse
第12题:
request.add Cookie (“username”. “joe”)
request.set Cookie (“username, “joe”)
response.add Cookie (username”, “joe”))
request.add Header (new Cookie (“username”, “joe”))
request.add Cookie (new Cookie (“username”, “joe”))
response.add Cookie (new Cookie (“username”, “joe”))
response.add Header (new Cookie (“username”, “joe”))
第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?()
第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?()
第15题:
Which is the true choice about the web container request processing model()?
第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?()
第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?()
第18题:
Store the data in a public instance variable in the servlet.
Add an attribute to the request object before using the request dispatcher.
Add an attribute to the context object before using the request dispatcher.
This CANNOT be done as the tag handler has no means to extract this data.
第19题:
REQUEST_URI
javax.servlet.forward.request_uri
javax.servlet.forward.REQUEST_URI
javax.servlet.request_dispatcher.request_uri
javax.servlet.request_dispatcher.REQUEST_URI
第20题:
Facade
View Helper
Transfer Object
Intercepting Filter
Composite Facade
第21题:
Dispatcher view=context.getDispatcher(viewURL);view.forward Request(request, response);
Dispatcher view=request.getDispatcher(viewURL);view.forward Request(request, response);
RequestDispatcher view. =context.getRequestDispatcher(viewURL);view.forward(request,response);
RequestDispatcher view=request.getRequestDispatcher(viewURL);view.forward(request, response);
第22题:
Add attributes to the session object.
Add attributes on the request object.
Add parameters to the request object.
Use the pageContext object to add request attributes.
Add parameters to the JSP’s URL when generating the request dispatcher.
第23题:
request.get Writer ():
request.get Reader ():
request.get Input Stream():
request.get Resource As Stream():
request.get Resource As Stream (Servlet Request. REQUEST):
第24题:
chain.forward(request, response);
chain.doFilter(request, response);
request.forward(request, response);
request.doFilter(request, response);