WebWork 2 : Results
This page last changed on Dec 13, 2004 by casey.
OverviewResults are string constants that Actions return to indicate the status of an Action execution. A standard set of Results are defined by default: error, input, login, none and success. Developers are, of course, free to create their own Results to indicate more application specific cases. Results are mapped to defined Result Types using a name-value pair structure.Result tagsResult tags tell WebWork what to do next after the action has been called. There are a standard set of result codes built-in to WebWork, (in the Action interface) they include: String SUCCESS = "success"; String NONE = "none"; String ERROR = "error"; String INPUT = "input"; String LOGIN = "login"; <result name="success" type="dispatcher"> <param name="location">/thank_you.jsp</param> </result> …and ERROR moving on to an error page, or the preceding page; <result name="error" type="dispatcher"> <param name="location">/error.jsp</param> </result> <action name="bar" class="myPackage.barAction"> <result name="success" type="dispatcher"> <param name="location">foo.jsp</param> </result> </action> or simplified <action name="bar" class="myPackage.barAction"> <result name="success" type="dispatcher">foo.jsp</result> </action> |
![]() |
Document generated by Confluence on Dec 14, 2004 16:36 |