Re: Servlets, send redirect and request scope



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?

Chris Smith wrote:
Berlin Brown <berlin.brown@xxxxxxxxx> wrote:
How would I do that. I know about filters. But what about in this
context.

Would I use the redirect to hit a 'filter'.

Yes. For example, you might use something like this:

1. Set a session attribute before you redirect containing the desired
request attributes and parameters.

2. Install a filter that intercepts all requests.

- If the session attribute doesn't exist, then just pass the request
along the chain without doing anything.

- If the session attribute does exist, then build a wrapped request
that returns the desired attributes and parameters, and pass that
along the chain.

--
Chris Smith

.



Relevant Pages

  • Re: User control remember state across pages without session
    ... Its a shame Microsoft don't extend viewstate beyond a single page because it ... An HTTP Request is received by the web server. ... It sends a Response to the client. ... > Request for a Page comes from any client, the Session Collection has a new ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: IIS bug-Concurrent request lock before IHttpModule.AcquireRequ
    ... into the session object. ... You can not have 2 simultaneous request for the same session. ... public partial class slow: System.Web.UI.Page ... public override void ProcessRequest ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: IIS bug-Concurrent request lock before IHttpModule.AcquireRequ
    ... shutDownMessage, ... IHttpModule stores the Hashtable of session objects in a private member ... You can not have 2 simultaneous request for the same ... protected void Page_Load(object sender, EventArgs ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Multiple instances of app under IIs and global com object - is it a problem?
    ... If IIS has, say, a pool of 25 threads, and your ASP Sessions do not exhibit ... objects) then you may not be looking at the same data when your next request ... This is why Session-level variables were provided -- in the Session ... this multiplicity of Module-level data means that you cannot ...
    (microsoft.public.vb.com)
  • Re: Multiple instances of app under IIs and global com object - is it a problem?
    ... If IIS has, say, a pool of 25 threads, and your ASP Sessions do not exhibit ... objects) then you may not be looking at the same data when your next request ... This is why Session-level variables were provided -- in the Session ... this multiplicity of Module-level data means that you cannot ...
    (microsoft.public.vb.general.discussion)