struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Kindler" <>
Subject AW: How to POST data to an external site from an action?
Date Wed, 03 May 2006 19:59:09 GMT

> -----Urspr√ľngliche Nachricht-----
> Von: Michael Jouravlev [] 
> Gesendet: Mittwoch, 3. Mai 2006 19:31
> An: Struts Users Mailing List;
> Betreff: Re: How to POST data to an external site from an action?
> On 5/3/06, Martin Kindler <> wrote:
> > Thank you all for answering!
> >
> > But I seem not to have stated my problem clearly: I know how I can 
> > POST to an uri using Java. My problem is that I want the user to be 
> > redirected (or forwarded) to the page my action has posted the data 
> > to.
> >
> > The easy way to handle this is:
> > put a button on my page by which the customer selects his preferred 
> > payment service. creati an action which prepares the values 
> needed by 
> > this payment service. This action forwards to a little 
> jsp-page which 
> > contains a form with all the data.
> > When the user submits the form, he is transferred to the 
> payment service
> > with all neccessary information.
> When a user is transferred to a payment service right from 
> the browser, how does your application know about this?

it does not :-), but first the payment service I want to implement is passed
an URL and sessionID from my app where it is redirecting (sending) my
customer back, after the payment is validated (or not). Second, I would
prefer control the change by an action in my app (this is what my question
is about). Even then my app only knows about it when the user comes back via
the payment service.

> > This means two clicks by the user for just selecting a payment 
> > service. I do want to make a one-click procedure from this. 
> A solution 
> > found by googling automates the second submit by 
> javascript. This is 
> > what I now have implemented. The question is: is there a 
> more elegant 
> > way?
> >
> > If I use any of the http client approaches (either using 
> or 
> > commons
> > httpclient) I get the response somewhere in my action, but 
> it should be in
> > the user's browser.
> > Probably one could say that I need sort of (transparent) proxy like
> > behaviour.
> Yep, your action behaves as proxy. Also, your application is 
> in the know of what is happening.

Well, it must behave like a proxy. Are there any examples how to do this? Or
some supporting software?
I surely can pass the response (i. e. the received HTML) to my customer, but
he should not be aware that that it is "my proxy".


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message