• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error while forwarding from struts.xml

 
Kartik Tal
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Am having two actions in my struts.xml , on return of the input from action class i would like to call action instead of JSP.
But am getting error



Am able to redirect to JSP successfully, but when am calling .action its giving error like
"The requested resource (/WHAM/customerListMain.action) is not available."
 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use below code instead of yours





 
Kartik Tal
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nishan,

Thanks for the reply, it worked fine but faced one more issue like

In my page am having 1 select box and 1 text field, as am making result="input".
the text field is having the same values which i entered before where as for select box they are reseting again.
The select box is not persisting with previous value.


 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Refer below link, that shows Struts 2 Result type.

Struts 2 Result Types

If you want to redirect your request to another action you can use Chain Result and Redirect Action Result. If you wan to persist previous action value use

type="chain" instead of type="redirect-action". So change redirect-action to chain type.
 
Kartik Tal
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot Nishan, it resolved my issue.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
*Ew*.

Action chaining is *strongly* discouraged.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic