3, Actions and Results
Actions is the basic execution unit that is registered in the WebWork configuration to respond to a specific request. In the MVC, Actions is the control section. Below is the basic steps for creating an action in the WebWork:
l Create a JSP page for calling an action;
l Create an Action class;
l Create a JSP page for processing an action returns a result;
l Register an action in xwork.xml;
(1) Example of Hello WebWorld
l xwork.xml file content is as follows:
"http://www.opensymphony.com/xwork/xwork-1.0.dtd">
action>
package>
xwork>
The configuration file tells webwork, there is an action called HelloWebWorld, implemented by the Lesson03.HellowebWorldAction; at the same time defining a result of success, pointing to the EX01-SUCCESS.JSP page;
l Call the page of the action EX01-INDEX.JSP:
hEAD>
Click The Button Below To Activate HelloWorldAction. P>