Not sure. Regarding this. But in any case you can use filter. Filter is a class that get access on the each ouput response before it should be sent to the client. So whenever request is fullfilied it comes to the filter and it can add or remove some attributes. If some redirection was performed during the request fullfillment it does not make any effect on the filter logic. http://www.javaworld.com/javaworld/jw-06-2001/jw-0622-filters.html
We're pleased to have you here with us on the Ranch, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.
In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.