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 Redirect and RedirectAction result types Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Redirect and RedirectAction result types" Watch "Redirect and RedirectAction result types" New topic
Author

Redirect and RedirectAction result types

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9629
    
    2

Guys,

What woule be the difference between these two Action types? Both seem to have the same purpose. I mean I can very well use the Redirect result type to redirect to an Action class. Why do I explicitly need a RedirectAction result type?


SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

You *could* redirect to an action, but then you have to specify the full URL of the action including the extension rather than simply specifying the action name (and optionally its namespace).

"redirectaction" works with the framework, "redirect" is a standard servlet spec redirect that ignores the framework.
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9629
    
    2

Good! Thanks!
Leonardo Carreira
Ranch Hand

Joined: Apr 07, 2009
Posts: 489

Sorry..

i have a little problem to redirect any action...

example :
now iam in URL : http://localhost:8080/MyApplication/Admin/Tasks/new.action
so..
how to i redirect to URL : http://localhost:8080/MyApplication/Admin/Example/show.action

now i use 2 process "GET" for go to http://localhost:8080/MyApplication/Admin/Example/show.action

first process go to URL : http://localhost:8080/MyApplication/Admin/Tasks/Just.action
which result to Velocity which embed :
<meta HTTP-EQUIV="REFRESH" content="0; url=http://localhost:8080/MyApplication/Admin/Example/show.action">

is it a good idea?..

CMIIW.

Regards,
W
(Sorry my english isn't too good)

Sorry, perhaps my english language isn't too good.. Prepare for SCJP 6, Please God help me.. ☼
References : [Java.Boot] [JavaChamp] [JavaPrepare]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Redirect and RedirectAction result types