File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Filters Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Filters" Watch "Filters" New topic


Sophie Angela
Ranch Hand

Joined: Jul 17, 2006
Posts: 46
can filters be used to create request and response wrappers?

if so why?

can Wrappers be used to create filters?
Arunava Bhattacharya

Joined: Dec 26, 2006
Posts: 15
Yes..filters can be used to make wrappers.This is because you might want to compress the response you are getting from a servlet and you can create your own custom response object and pass it as a parameter to the chain.doFilter(req,res) method.

For details of this please refer to HFSJ book.It has been explained beautifully there.Though you do not need to know it in detail.

Thanks....<br />babun
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
This is phrasing it a bit strangely- filters are not used to create wrappers or vice versa. In a filter you'd create a wrapper if necessary (it's not required).
I agree. Here's the link:
subject: Filters
It's not a secret anymore!