File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Can I forward(return) a url from Struts Action Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Can I forward(return) a url from Struts Action " Watch "Can I forward(return) a url from Struts Action " New topic
Author

Can I forward(return) a url from Struts Action

swati mittal
Ranch Hand

Joined: Oct 21, 2008
Posts: 39
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

Joined: Dec 13, 2007
Posts: 81
Struts Action returns a ActionForward object. So you can not return or forward a URL.


Saravanan
SCJP 5.0(98%), SCWCD 5.0 (100%), OCA
Ananth Chellathurai
Ranch Hand

Joined: Nov 21, 2007
Posts: 349

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


Ananth Chellathurai [Walk on software]
swati mittal
Ranch Hand

Joined: Oct 21, 2008
Posts: 39
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

Joined: Feb 19, 2008
Posts: 2902
    
    1

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 ??


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
swati mittal
Ranch Hand

Joined: Oct 21, 2008
Posts: 39
But I am doing cheksum calculation in my action and i also want to send that parameter into url.
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

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 !
 
 
subject: Can I forward(return) a url from Struts Action