You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Richard Aukland <ri...@aukinfo.com> on 2004/08/31 14:07:33 UTC

Submit to 3rd party URL after completing Action

Hi,

I have a form which must be sent to an external site for payment
processing. But first I want to run it through my own action to
insert the values in the database, and then forward to the 3rd party
URL for payment.

If I submit to the 3rd party directly from a JSP using an html form
(ass opposed to struts html:form) then they recieve the data on my
form no problem. But when I use struts and go through my action then
all data is lost.

Here is my mapping bit;
<action input=".base.signup.step3" parameter="action"
name="signupForm" path="/SubmitSignup3"
   type="uk.co.membershiponline.website.actions.SignupAction" 
validate="true">
   <forward name="next"
path="https://select.worldpay.com/wcc/purchase" redirect="true"/>
   <forward name="failure1" path=".base.signup.step1"
redirect="false"/>
   <forward name="failure2" path=".base.signup.step2"
redirect="false"/>
   <forward name="cancel" path=".base" redirect="false"/>
   <forward name="previous" path=".base.signup.step2"
redirect="false"/>
  </action> 

It is the 'next' forward that goes to the 3rd party. I have tried
setting redirect tru/false. Same problem. The form is in session
scope.

I think I am not understanding something about how this works. 

Any pointers gratefully received, 
Richard


Richard Aukland
49 Ravensmere, Beccles, 
Suffolk, UK. NR34 9BE
Tel/Fax. +44(0)1502 470162
Cell.    +44(0)7906 094578
mailto:  richard@aukinfo.com
http://www.aukinfo.com



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


Re: Submit to 3rd party URL after completing Action

Posted by Bill Siggelkow <bi...@bellsouth.net>.
You are only going to be able to redirect to an external URL. However, 
when you redirect its a new request so the form data is lost. I would 
use the Jakarta Commons HttpClient to do the posting.

Bill Siggelkow

Richard Aukland wrote:
> Hi,
> 
> I have a form which must be sent to an external site for payment
> processing. But first I want to run it through my own action to
> insert the values in the database, and then forward to the 3rd party
> URL for payment.
> 
> If I submit to the 3rd party directly from a JSP using an html form
> (ass opposed to struts html:form) then they recieve the data on my
> form no problem. But when I use struts and go through my action then
> all data is lost.
> 
> Here is my mapping bit;
> <action input=".base.signup.step3" parameter="action"
> name="signupForm" path="/SubmitSignup3"
>    type="uk.co.membershiponline.website.actions.SignupAction" 
> validate="true">
>    <forward name="next"
> path="https://select.worldpay.com/wcc/purchase" redirect="true"/>
>    <forward name="failure1" path=".base.signup.step1"
> redirect="false"/>
>    <forward name="failure2" path=".base.signup.step2"
> redirect="false"/>
>    <forward name="cancel" path=".base" redirect="false"/>
>    <forward name="previous" path=".base.signup.step2"
> redirect="false"/>
>   </action> 
> 
> It is the 'next' forward that goes to the 3rd party. I have tried
> setting redirect tru/false. Same problem. The form is in session
> scope.
> 
> I think I am not understanding something about how this works. 
> 
> Any pointers gratefully received, 
> Richard
> 
> 
> Richard Aukland
> 49 Ravensmere, Beccles, 
> Suffolk, UK. NR34 9BE
> Tel/Fax. +44(0)1502 470162
> Cell.    +44(0)7906 094578
> mailto:  richard@aukinfo.com
> http://www.aukinfo.com


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