An Action that forwards control via a "success" ActionFoward.
A recommended strategy is that view pages should link only to Actions and
never directly to other views. In situations where the view does not require
any preparation you can use a SuccessAction, specifying the view as an
ActionForward named "success" in your action mapping.
e.g. If you configure an ActionMapping in struts-config.xml like this:
<action path="/prepareView"
type="examples.SuccessAction">
<forward name="success" path="/jsp/View.jsp"/>
</action>
You could create a link to the view (via the Action) as follows:
<html:link action="/prepareView">Display 'view' page</html:link>
If you later change your application such that the view page requires some
initialization you can change a single ActionMapping definition in
struts-config.xml rather than lots of link definitions in many JSPs.
version: $Rev: 471754 $ $Date: 2006-11-06 08:55:09 -0600 (Mon, 06 Nov 2006) $ |