You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by matador <ma...@yahoo.com> on 2006/02/24 14:00:04 UTC

actionForward & page needs a queryString

how to do this?

existing jsp (model 1 arch) is dependent on querystring parameter (e.g. ?
vId=256), so instead of posting this page to another page that updates the 
db, i post it to an action class etc.  fine no probs there.

but the forward for the action class needs to go back to the posting page 
with the same queryString.  one can define an actionforward for that 
posting page, but the querystring is lost.  (yes i do a redirect, so that 
original value is lost).  

what i devised was sticking that param in session, then forward to a dummy 
jsp that pulls the param out of the session and redirects to that original 
url with the querystring intact -- a messy kind of hack.

is there a better way?


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: actionForward & page needs a queryString

Posted by Michael Jouravlev <jm...@gmail.com>.
On 2/24/06, matador <ma...@yahoo.com> wrote:
> how to do this?
>
> existing jsp (model 1 arch) is dependent on querystring parameter (e.g. ?
> vId=256), so instead of posting this page to another page that updates the
> db, i post it to an action class etc.  fine no probs there.
>
> but the forward for the action class needs to go back to the posting page
> with the same queryString.  one can define an actionforward for that
> posting page, but the querystring is lost.  (yes i do a redirect, so that
> original value is lost).
>
> what i devised was sticking that param in session, then forward to a dummy
> jsp that pulls the param out of the session and redirects to that original
> url with the querystring intact -- a messy kind of hack.
>
> is there a better way?

Create and return your own instance of ActionForward, stick parameter
into URL. You can do it manually, or use ActionRedirect class (Struts
1.2.7+).

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org