struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Kindler" <kindl...@arcor.de>
Subject AW: How to POST data to an external site from an action?
Date Wed, 03 May 2006 09:16:13 GMT
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.

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 java.net 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.

Martin



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


Mime
View raw message