Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Actionforward Problem

 
amit sharma
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 456
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In order to create a forward that redirects, simply specify redirect="true" in the forward definition in your struts-config.xml file.
 
amit sharma
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's how you'd do it:
 
amit sharma
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot this is what i want.
Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic