KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > web > SimpleAction


1 package test.web;
2
3 /**
4  * Simple WebWork action.
5  *
6  * <p>WebWork is a web application framework for J2EE. It is based on a concept called "Pull HMVC"
7  * Pull Hierarchical Model View Controller). It supports an arrange of view technologies - XSLT, JSP,
8  * Velocity, Applet, Jasper Reports, and more.</p>
9  *
10  * <p>Actions are central to WebWork (WW) as they are the controllers in your application. For more
11  * information, check the <a HREF="http://www.opensymphony.com/webwork/">WebWork Documentation</a>.
12  *
13  * @webwork.action
14  * name="foo"
15  * views="a=tjo.jsp,b=blah.jsp,c=duh.jsp"
16  *
17  * @webwork.action
18  * name="bar"
19  * views="qwe=tjo.jsp,rty=blah.jsp,xyz=duh.jsp"
20  *
21  * @webwork.action
22  * name="xyzzy"
23  * error="blah.jsp"
24  * input="duh.jsp"
25  * success="tjo.jsp"
26  *
27  * @webwork.action
28  * name="myaction"
29  * error="blah.jsp"
30  * input="duh.jsp"
31  * success="tjo.jsp"
32  * views="login=login.jsp"
33  *
34  * @author <a HREF="mailto:youremail@yourdomain.com">youremail@yourdomain.com</a>
35  */

36 public class SimpleAction implements webwork.action.Action {
37     /**
38      * This method is where the logic of the action is executed. Parameters are passed
39      * by calling set-methods, or by implementing the ParameterAware interface.
40      */

41     public String JavaDoc execute() {
42         // Simple. Very simple.
43
return SUCCESS;
44     }
45
46     /**
47      * @webwork.command
48      * error="add_error.jsp"
49      * name="add"
50      * success="add_success.jsp"
51      */

52     public String JavaDoc doCmd1() {
53         return SUCCESS;
54     }
55
56     /**
57      * @webwork.command
58      * error="cmd2_error.jsp"
59      * success="cmd2_success.jsp"
60      */

61     public String JavaDoc doCmd2() {
62         return SUCCESS;
63     }
64 }
Popular Tags