• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

forwarding to a URL outside of the web application

 
Chris-Huisman
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<p>
I need to pass information to a payment service site in my struts application. To do this i have to link to another site. I would like to do this via my Action by using a forward of some type. Is this possible? Can I do it with a sendRedirect? How do you "link" to a URL in an Action class?
</p>
<p>
The other option is to put the website address in the forms action parameter, ie: <form action="https://paymentsite.html">. Is there a way to use the struts html form taglib to do this?
</p>
 
Tim Holloway
Saloon Keeper
Posts: 18359
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Struts 1.1 you can set up an Action forward to go to any URL, not just local ones. All that's really required is that the receiving URL be prepared to understand what you send it.
A JSP can use the <html:link> tag to refer offsite.
Of course, somewhere along the line, you'll need to make sure that the user comes back to you!
For Web Services-type functions, the server might use a URLConnection class in the Action processor if a fast enough response can be assured. The results coming back through the connection can then be used to select the appropriate action to present to the user.
 
Chris-Huisman
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So this would be valid then?
<forward name="payment" path="https://mypayment/service.html"/>
c.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic