|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.struts.action.Action
examples.SuccessAction
public class SuccessAction
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.
Field Summary |
---|
Fields inherited from class org.apache.struts.action.Action |
---|
servlet |
Constructor Summary | |
---|---|
SuccessAction()
Constructor for SuccessAction. |
Method Summary | |
---|---|
ActionForward |
execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
Returns the ActionForward named "success" if one is
configured or null if it cannot be found. |
Methods inherited from class org.apache.struts.action.Action |
---|
addErrors, addMessages, execute, generateToken, getErrors, getLocale, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, saveErrors, saveErrors, saveMessages, saveMessages, saveToken, setLocale, setServlet |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SuccessAction()
Method Detail |
---|
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception
ActionForward
named "success" if one is
configured or null
if it cannot be found.
Searches first for a local forward, then a global forward.
execute
in class Action
mapping
- The ActionMapping used to select this instanceform
- The optional ActionForm bean for this request (if any)request
- The HTTP request we are processingresponse
- The HTTP response we are creating
Exception
- if mapping.findForward throws an Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |