tags:

views:

119

answers:

1

how can i use common forward for all actions . measn i dont want to writ common forward in all actions

i dont want to write this in all

+1  A: 

It sounds like you're just describing a global forward. Global forwards are defined in the struts-config.xml file. That way, the forward is defined for all actions so any action can use the forward.

So you would place something like the following in your struts-config.xml file:

  <global-forwards>
    <forward name="error" path="jsp/error.jsp"/>
  </global-forwards>

Then just forward to "error" in your action class:

return mapping.findForward("error");
JasonStoltz