You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ming Li <em...@yahoo.com> on 2005/11/14 17:56:15 UTC
forward to an extental URL
I saw there was a similar post in this forum, but the
solutions don't work for me.
What I want to do is getting a form posted to an
action, after some processing then forward to an
external URL (for payment process).
I tried the solutions suggested in this forum
(http://www.mail-archive.com/struts-user@jakarta.apache.org/msg78766.html)
by adding "redirect = true" and contextRelative=false"
in my action forward as follows:
<forward name="checkout" path="https://... ..."
redirect="true" contextRelative="false">
What I get is an 404 error. Also, my concern about
redirect is if the form data will be lost.
Thanks in advance.
Ming
__________________________________
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: forward to an extental URL
Posted by Ming Li <em...@yahoo.com>.
Hi Laurie, thank you for the reply. The 404 must come from my struts action forward. Since if I post the form directly to the external URL, not from the action, everything is fine.
Laurie Harper <la...@holoweb.net> wrote: Ming Li wrote:
> I saw there was a similar post in this forum, but the
> solutions don't work for me.
>
> What I want to do is getting a form posted to an
> action, after some processing then forward to an
> external URL (for payment process).
>
> I tried the solutions suggested in this forum
> (http://www.mail-archive.com/struts-user@jakarta.apache.org/msg78766.html)
> by adding "redirect = true" and contextRelative=false"
> in my action forward as follows:
>
>
> redirect="true" contextRelative="false">
>
> What I get is an 404 error. Also, my concern about
> redirect is if the form data will be lost.
A 404 from the remote server (indicating you have the URL wrong), or a
404 from your Struts application (indicating the redirect isn't going to
the remote server at all)?
You're correct that the request to the remote server will not contain
any form data. If you need to include query parameters in that request,
you'll need to add them to the URL you redirect to, as query parameters
(see ActionRedirect in Struts 1.3 and later for an easy way to
accomplish that).
L.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
---------------------------------
Yahoo! FareChase - Search multiple travel sites in one click.
Re: forward to an extental URL
Posted by Laurie Harper <la...@holoweb.net>.
Ming Li wrote:
> I saw there was a similar post in this forum, but the
> solutions don't work for me.
>
> What I want to do is getting a form posted to an
> action, after some processing then forward to an
> external URL (for payment process).
>
> I tried the solutions suggested in this forum
> (http://www.mail-archive.com/struts-user@jakarta.apache.org/msg78766.html)
> by adding "redirect = true" and contextRelative=false"
> in my action forward as follows:
>
> <forward name="checkout" path="https://... ..."
> redirect="true" contextRelative="false">
>
> What I get is an 404 error. Also, my concern about
> redirect is if the form data will be lost.
A 404 from the remote server (indicating you have the URL wrong), or a
404 from your Struts application (indicating the redirect isn't going to
the remote server at all)?
You're correct that the request to the remote server will not contain
any form data. If you need to include query parameters in that request,
you'll need to add them to the URL you redirect to, as query parameters
(see ActionRedirect in Struts 1.3 and later for an easy way to
accomplish that).
L.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org