File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Question about HttpRequestWrapper and HttpResponseWrapper Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Question about HttpRequestWrapper and HttpResponseWrapper" Watch "Question about HttpRequestWrapper and HttpResponseWrapper" New topic

Question about HttpRequestWrapper and HttpResponseWrapper

Benny Tang

Joined: Aug 03, 2003
Posts: 26
Hi All,
I want to ask what is the use of the class javax.servlet.http.HttpServletRequestWrapper and javax.servlet.http.HttpServletResponseWrapper? As I seldom use these classes. Can anyone tell me their usage ?

Joined: Dec 02, 2003
Posts: 2
I think they are both implementing exact things as request/response do, the advantage is that they are applying wrapper design pattern. As of the advantage of wrapper, you can check j2ee design pattern.
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13024
People use these to implement special handling of things you can't normally get at. For example, one person wanted to substitute values in response headers. See also the javax.servlet.Filter and related interfaces.
I agree. Here's the link:
subject: Question about HttpRequestWrapper and HttpResponseWrapper
jQuery in Action, 3rd edition