5.QUESTION 32: 
A Certkiller .com developer chooses to avoid using SingleThreadModel but wants to 
ensure that data is updated in a thread-safe manner. 
Which two can support this design goal? (Choose two.) 
A. Store the data in a vocal variable. 
B. Store the data in an instance variable. 
C. Store the data in the HttpSession object. 
D. Store the data in the ServletContext object. 
E. Store the data in the ServletRequest object. 
Answer: A, E 
C为什么不行。
6.HttpSessionBindingListener监听器中的valueBound和valueUnbound分别对应什么事件?
7.QUESTION 35: 
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 
Answer: D 
此题没看懂。
8.QUESTION 36: 
Which three are true about the HttpServletRequestWrapper class? (Choose three.) 
A. The HttpServletRequestWrapper is an example of the Decorator pattern. 
B. The HttpServletRequestWrapper can be used to extend the functionally of a servlet 
request. 
C. A subclass of HttpServletRequestWrapper CANNOT modify the behavior of the 
getReader method. 
D. An HttpServletRequestWrapper may be used only by a class implementing the 
javax.servlet.Filter interface. 
E. An HttpServletRequestWrapper CANNOT be used on the request passed to the 
RequestDispatcher.include method. 
F. An HttpServletRequestWrapper may modify the header of a request within an object 
implementing the javax.servlet.Filter interface. 
Answer: A, B, D 
F为什么不对。
9.QUESTION 38: 
A Certkiller .com developer is designing a multi-tier web application and discovers a 
need to log each incoming client request. 
Which two patterns, taken independently, provide a solution for this problem? 
(Choose two.) 
A. Transfer Object 
B. Service Locator 
C. Front Controller 
D. Intercepting Filter 
E. Business Delegate 
F. Model-View-Controller 
选什么?一道题20分。

解决方案 »

  1.   

    先说第一个:HttpSession 是多线程共享的,它根据客户端IP,请求时间等一系列的数据生成了一个唯一编号,
    只要是同一种浏览器,开多少画面都是那一个session。你把答案都说了---我们不都成马后炮了。不玩了。
      

  2.   

    7.QUESTION 35: 
    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 
    Answer: D Servlet A 接受一个请求, 这个请求fowards到同一个应用服务器之下的另一个web应用, Servlet A需要和Servlet B共享一些数据, 但是这些数据不可以在Servlet A所在的web引用的其他Servlet中访问, 下面哪一个对象可以满足这种数据共享呵呵, 那就当然是D了
      

  3.   

    考这个可以看head first系列的书 都是考试出题那帮人写的
      

  4.   

    为什么是D呢?response怎么共享数据,想象不出这样的应用场景。