> How would I do that. I know about filters. But what about in this
> context.
>
> Would I use the redirect to hit a 'filter'.
What you are saying makes sense, except for the last part. Let me add a
little bit more pseudo code (note I have some of my code in there):
public class TestReconnectServlet extends BaseServlet {
doPost() {
String theKey = request.getParameterKey();
String theValue = request.getParameter(theKey);
Object arr [] = new Object[2];
arr[0] = theKey;
arr[1] = theValue;
session.setValue("mysession.before.redirect", arr);
response.sendRedirect(GoToFilter?);
}
}
public class TheFilter implements Filter {
public void doFilter(ServletRequest reqBasic, ServletResponse
respBasic, FilterChain chain) {
HttpServletRequest req = (HttpServletRequest) reqBasic;
HttpServletResponse res = (HttpServletResponse) respBasic;
/// Here ????????? build up the request object?
String key, value = session.getValue(arr);
request .setValue(key, value);
...
chain.doFilter(req, res);
}
}
Hmm, this might actually work?
response.sendRedirect(GoToFilter?);
When I do the redirect, it is to the GoToFilter?
> > How would I do that. I know about filters. But what about in this
> > context.
[quoted text clipped - 14 lines]
> that returns the desired attributes and parameters, and pass that
> along the chain.
Chris Smith - 31 Aug 2006 17:01 GMT
> /// Here ????????? build up the request object?
> String key, value = session.getValue(arr);
> request .setValue(key, value);
Check the API docs for javax.servlet.http.HttpServletRequestWrapper.
You'd build a subclass of that, and pass it to FilterChain.doFilter in
place of the original ServletRequest.

Signature
Chris Smith