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

Actionforward Problem

amit sharma
Ranch Hand

Joined: Jul 19, 2006
Posts: 129
In my action class what i need is that whenever user successfully authenticated i redirect it to another page .I am able to do redirect but now i have to hard code the path in action class .Can i use the path which is associated with forward name ="success" and do redirect instead of forward .
Thanks
Jan Groth
Ranch Hand

Joined: Feb 03, 2004
Posts: 456
sure you can... what exactly is your problem?

you define as many mappings and forwards as you want in the struts-config.xml and use business code in the action to determine the appropriate forwards.

this should work without any problems or troubles.

pls post details about your problem,
jan
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
In order to create a forward that redirects, simply specify redirect="true" in the forward definition in your struts-config.xml file.


Merrill
Consultant, Sima Solutions
amit sharma
Ranch Hand

Joined: Jul 19, 2006
Posts: 129
I specify redirect=true in struts config and it solve my problem .Thanks a lot.I have another doubt regarding ActionForward.
Let i have this action mapping in struts

In above code i declare 2 forwards and in action class i made ActionForward
object and i return that ActionForward .Suppose i need to redirect to path specify by forward "success" (without declaring redirect in struts.config).
How to do this
Thanks
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Here's how you'd do it:
amit sharma
Ranch Hand

Joined: Jul 19, 2006
Posts: 129
Thanks a lot this is what i want.
Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Actionforward Problem
 
Similar Threads
How to use the ShowView Action?
Exception creating bean of form class
Forward to issue
forward from one action to another?
IllegalStateException