Re: Servlets, send redirect and request scope



Berlin Brown <berlin.brown@xxxxxxxxx> wrote:
Yea, but it isnt as clean and not generic. For example, I would have
find every instance of request 'getParameters' that existed at the end
servlet and replace with the session getting code.

I wish there was a way to fill in values in the request object, that
way I wouldnt have to change any code at all.

And with a modern servlet spec, there is! You'll still have to get the
new information to the new request somehow. Once it's there, though,
you can set up a servlet filter that builds a wrapped ServletRequest
object and adds parameters and/or request attributes. Google on servlet
filters for details.

--
Chris Smith
.



Relevant Pages

  • Re: how does the Model (Command), in MVC, return objects to a servlet?
    ... Command command = lookupCommand; Result result = ... command.execute(request); ... The Base Enterprise Servlet from which all Enterprise Servlet ... public void service ...
    (comp.lang.java.help)
  • Re: Servlet design question
    ... don't put huge objects in the session, ... Concerning fields in the servlet class itself, no, you shouldn't do it, ... > for that request only (e.g. request-related stuff scooped out of ... > wrapper also contains a reference to my SessionState object, ...
    (comp.lang.java.programmer)
  • Re: pls explain these methods...
    ... >> parameter instead of coding it into the servlet. ... and pass the information as a request attribute. ... with the request to some other piece of the request processing chain. ... a JSP page to generate the actual request: ...
    (comp.lang.java.help)
  • Saving request parameters before redirect
    ... I've been unable to solve a servlet problem. ... it must first store the original request parameters. ... parameters in the current request object and resume processing. ...
    (comp.lang.java.developer)
  • Saving request parameters before redirect
    ... I've been unable to solve a servlet problem. ... it must first store the original request parameters. ... parameters in the current request object and resume processing. ...
    (comp.lang.java.programmer)