aspose file tools
The moose likes Struts and the fly likes Redirect and RedirectAction result types Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply 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: 8795

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, SCBCD Hints - Demnachst, SCDJWS - Auch Demnachst
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: 8795

Good! Thanks!
Leonardo Carreira
Ranch Hand

Joined: Apr 07, 2009
Posts: 482
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://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Redirect and RedirectAction result types
 
Similar Threads
dispatch and redirect-action
Action-Redirection. Very Frustrating problem
Struts2 Action Mapping Problem - No configuration found for the specified action
Difference between redirect and redirectAction result type
Interceptor messes up action class in Struts2