You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by prasad iyer <g_...@yahoo.co.uk> on 2009/12/10 22:50:34 UTC
redirect with parameter
Hi,
I am stuck with a problem I want to add parameters to redirect. Following is the example.
<package name="org.caltex.signup" extends="struts-default">
<action name="SignUpAction" class="org.caltex.SignUpAction">
<result name="redirecturl" type="redirect">
<param name="location">${redirecturl}</param>
<param name="email">${email}</param>
</result>
<result name="input">/left/jsp/signup/signup.jsp</result>
<result name="error">/left/jsp/signup/signup.jsp</result>
</action>
</package>
but email is not getting appended to the url.
Help would be highly appreciated
thanks in advance
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: redirect with parameter
Posted by prasad iyer <g_...@yahoo.co.uk>.
Hi Neil,
Thanks a lot.
I solved the problem
<package name="org.cross.signup" extends="struts-default">
<action name="SignUpAction" class="org.cross.SignUpAction">
<result name="redirecturl" type="redirect">
<param name="location">/${redirecturl}?${urlparameters}</param>
<param name="parse">true</param>
</result>
<result name="input">/left/jsp/signup/signup.jsp</result>
<result name="error">/left/jsp/signup/signup.jsp</result>
</action>
</package>
I am getting redirecturl from property and urlparameters has the getter and setter in Action class.
I can't use the
<param name="encode">true</param> because it encodes both redirecturl and urlparameters.
cheers
----- Original Message ----
From: Neil Aggarwal <ne...@JAMMConsulting.com>
To: Struts Users Mailing List <us...@struts.apache.org>
Sent: Thu, 10 December, 2009 15:20:55
Subject: RE: redirect with parameter
Prasad:
> I am stuck with a problem I want to add parameters to
> redirect. Following is the example.
Here is what works for me:
In struts.xml:
<result name="success" type="httpheader">
<param name="status">303</param>
<param name="headers.location">${redirectUrl}</param>
</result>
I generate the full url in my bean code including all
parameters I want encoded.
I hope that helps,
Neil
--
Neil Aggarwal, (281)846-8957, http://UnmeteredVPS.net
Host your struts app on a CentOS VPS for only $25/month!
Unmetered bandwidth = no overage charges, 7 day free trial
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: redirect with parameter
Posted by Neil Aggarwal <ne...@JAMMConsulting.com>.
Prasad:
> I am stuck with a problem I want to add parameters to
> redirect. Following is the example.
Here is what works for me:
In struts.xml:
<result name="success" type="httpheader">
<param name="status">303</param>
<param name="headers.location">${redirectUrl}</param>
</result>
I generate the full url in my bean code including all
parameters I want encoded.
I hope that helps,
Neil
--
Neil Aggarwal, (281)846-8957, http://UnmeteredVPS.net
Host your struts app on a CentOS VPS for only $25/month!
Unmetered bandwidth = no overage charges, 7 day free trial
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org