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 Error while forwarding from struts.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Error while forwarding from struts.xml" Watch "Error while forwarding from struts.xml" New topic
Author

Error while forwarding from struts.xml

Kartik Talasu
Ranch Hand

Joined: Aug 21, 2009
Posts: 98
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

Joined: Sep 07, 2008
Posts: 684

Use below code instead of yours






Thanks, Nishan Patel
SCJP 1.5, SCWCD 1.5, OCPJWSD Java Developer,My Blog
Kartik Talasu
Ranch Hand

Joined: Aug 21, 2009
Posts: 98
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

Joined: Sep 07, 2008
Posts: 684

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 Talasu
Ranch Hand

Joined: Aug 21, 2009
Posts: 98
Thanks a lot Nishan, it resolved my issue.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

*Ew*.

Action chaining is *strongly* discouraged.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error while forwarding from struts.xml
 
Similar Threads
Populating a Dropdown Box
Struts2 CannotRenderException
Action configuration problem in Struts 2
No result defined for action
<s:select in <s:iterate tag displaying with comma seperated value