You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Adam Lipscombe <ad...@expensys.com> on 2004/09/30 10:41:03 UTC

NEWBIE: How to pass parameters between JSPs

Hi,
 
Under some circumstances my app receives a set of request params at the
login.jsp page. After the user has authenticated these params need to be
passed to the next page to be displayed (home.jsp). home.jsp then displays
differently depending on the params passed. Normally there will be no params
at all.
 
 
My original plan was to pass the params through to the login action (that
gets called from the login.jsp) and then forward them to home.jsp by
building a parameter "?name=value&name1=value1" string and appending it to
the home.jsp url.
 
My problem seems to be passing the params from login.jsp to the login
action:
 
1. First, I tried storing the params in the request with
request.setAttribute() in the login.jsp page.
    But, the login action gets a different request instance from that in
which the request params were stored so the params are no longer there.
 
    (I could store them in the session I suppose but don't really want them
there for the duration of the users session. Seems like it should be
easier....).
 
 
2. I then tried storing the params in the login actionform but for some
reason this doesn't work either.
 
 
I trawled through the mailing list archive - lots of oblique references to
similar problems but nothing definitive
 
What is the best way to do this? Is there a standard solution?
 
 
 
TIA - Adam