if I want to modify request parameters inside a filter is it right to set request attributes after modifying? Is it the only strategy or is there a better one?
If I have chained more than one filter for the same servlet or url the order of execution is that of filter tag regardless of the order of filter mapping?I tried to chain two filters but it is not exactly clear to me the order of execution(request, response, target servlet) - for instance when destroy() is called for each filter.It makes no difference using <servlet-name> instead of <url-pattern>?Apart from Compression Filter, could you suggest me another example of Wrapper?<dispatcher> INCLUDE, FORWARD, ERROR(how can I call an ERROR filter?) let other components of the application-instead of the client- to interact with the filter but if I have a RequestDispatcher.forward() to the first filter of a chain, also the following filters of the chain will have a FORWARD <dispatcher>?Can change the <dispatcher>inside a chain?Every kind of component can use a filter before it reaches a target servlet??The target must be a servlet, that is filters apply only to servlets?
Not very clear ideas about filters!!
Joined: Jul 26, 2009
I tried the code of CompressionFilter of the HF book on page 722.On the Compression Filter method doFilter I get a NullPointerException on line
it can be ServletContext ctx or FilterConfig cfg, could you give me a suggestion?