A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Result (dispatch) in Struts2
Paul Michael Serrano
Joined: Nov 22, 2004
Apr 07, 2010 11:16:05
Is there a way that I could dispatch the result of my action to a different action? I'm trying to work with the struts.xml but I think it's not working fine.
<action name="navigation" class="xxx.xxx.xxx.SampleAction.java" method="navigation"> <result name="view">/jsp/ta/manageview.jsp</result> <result name="edit">/jsp/ta/manageedit.jsp</result> <result name="navigate_step_edit" type="dispatch">edit_step</result> <!-- result that needed to be dispatched to different action --> <result name="navigate_step_view" type="dispatch">view_step</result> <!-- result that needed to be dispatched to different action --> </action> <action name="edit_step" ........ > ...... </action> <action name="view_step" ........ > ...... </action>
Joined: Sep 29, 2008
Apr 07, 2010 16:18:20
A "redirectAction" is the normal way to redirect to a different action. If you want to forward, you're limited to "dispatch", in which case you need the complete URL (bad idea), or use a "chain" result, which is probably an even worse idea.
It is sorta covered in the
JavaRanch Style Guide
subject: Result (dispatch) in Struts2
Can not Populate the form on combo box change
While click on button action is not reach in LoginAction class
Jsp is not displaying in Struts2
How to perform operations like insert,delete,add,move next etc in jsp page?
dispatch and redirect-action
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014