Reputation: 13
In this thread it was cleary stated why ServletResponseWrapper
can be useful. What about ServletRequestWrapper
? What real application may use a ServletRequestWrapper
for if in fact all could be achieved with just a Filter? Can somebody provide a scenario?
Upvotes: 1
Views: 191
Reputation: 4994
The question is not to use an implementation Filter
or a ServletRequestWrapper
/ ServletResponseWrapper
. The answer that you linked in your question is good, but it doesn't point out an important fact: wrappers are often, or even mostly, created during the execution of the method doFilter()
in a class which implements the interface Filter
.
Take a careful look at the links which BalusC has posted in his comment.
Upvotes: 2