This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes HttpServletRequestWrapper Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "HttpServletRequestWrapper" Watch "HttpServletRequestWrapper" New topic
Author

HttpServletRequestWrapper

muthulingam Jayakanthan
Ranch Hand

Joined: Feb 27, 2005
Posts: 43
can some one please send me small note about HttpServletRequestWrapper from the Head First Book or anywhere else. I have only Servlet Spec with me. But there is not much info about that.
alzamabar
Ranch Hand

Joined: Jul 24, 2002
Posts: 379
Originally posted by muthulingam Jayakanthan:
can some one please send me small note about HttpServletRequestWrapper from the Head First Book or anywhere else. I have only Servlet Spec with me. But there is not much info about that.


The wrapper classes related to ServletRequest, ServletResponse, HttpServletRequest and HttpServletResponse are used when you want to expose to your clients an 'enhanced' version of the above objects. This is possible because a wrapper delegates to the 'official' object all the standard functionalities. This is possible because a wrapper normally should accept in its constructor an instance of the 'official' object. So it becomes easy for a wrapper having a reference to an instance of a certain class, and implementing its same interface, to invoke the 'official' object's methods (acting, that's it, as a wrapper). However, by extending a wrapper class, you can override only those methods for which you want to provide special functionalities. Then, from within the class from which you want to create the 'empowered' object, you will create an instance of the class extending the wrapper and you will pass this instance to whichever client of your empowered object.

The wrapper class is an implementation of the Decorator/Wrapper pattern.


Marco Tedone<br />SCJP1.4,SCJP5,SCBCD,SCWCD
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HttpServletRequestWrapper