You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ke...@telenor.com on 2001/02/07 16:56:56 UTC

Redirecting the user

Hi!

I have a question concerning redirecting:

On our site we have a page with an input field and a drop-down-list-box.
Based on the value of the drop-down-listbox we want to redirect the user to
different servers. We also want to send the value of the input field as a
parameter for each redirect.

To do this I put the following code in my action-class:

if (valueOfDropDownListBox.equals("A"))
	return new ActionForward("http://siteA?param1=" + inputFieldValue,
true);
else
	return new ActionForward("http://siteB?param2=" + inputFieldValue,
true);

There will be requests with very different inputField-values (this will
cause the creation of lots of new ActionForward objects). Is this an okay
way to solve this, or is there a better way to do the redirecting with
parameters in STRUTS?

Greetings

Ken