• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question about HttpRequestWrapper and HttpResponseWrapper

 
Benny Tang
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?
Thanks,
Benny
 
j2eelearner
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
Thanks
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13055
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic