Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can I forward(return) a url from Struts Action

 
swati mittal
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have one action class, Can I forward(return) a url from Struts Action.
I don't want to return success or failure.
 
Thirugnanam Saravanan
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Struts Action returns a ActionForward object. So you can not return or forward a URL.
 
Ananth Chellathurai
Ranch Hand
Posts: 349
Eclipse IDE Hibernate Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you can do it,



But why do want to forward it to URL instead of following the struts way. More explanations on your requirement would help you to get the best solution.

Ananth Chellathurai
 
swati mittal
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ananth Chellathurai,

I want to redirect my jsp page to any payment gateway from my action in struts by post method.
so please let me know How to send URL through action to any site through method post.
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want to redirect or forward user to some Payment Gateway URL, then why do you require Action , just Provide some buttons, like 'Pay', in <form action="URL_FOR_PAYMENT_GATEWAY"...></form> code..

By the way, Which Payment Gateway you want to integrate ??
 
swati mittal
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But I am doing cheksum calculation in my action and i also want to send that parameter into url.
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, then Either, you save "URL + checksum" value in a request object OR Only cheksum value in request object and transfer it to JSP page, and retrieve in Pay button form action, like this



Hope this Helps,

I once again ask you which Payment Gateway , you are integrating with ?

I have an experience of PayPal, Authorize.net and Google Checkout , and neither of this requires the arrangement as you want !
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic