Recently I plan to start learning Webwork, here I want to take this blog to record my learning history, I hope to make an exchange with all the webwork enthusiasts.
Not much nonsense, I will introduce my preparation for this study:
1. Tools and Environment Preparing JDK1.4.2 (% java_home%) Eclipse3.0 (recommended plugin: lomboz, xmlbuddy, tomcatplugin) WebWork2.1 (% webwork_home%) Tomcat5.0.25
2. Learning information Preparing the tutorial of Webwork2.1 (under WebWork2.1 / DOC)
The following is starting.
[First WebWork Program HelloWorld's Construction]
1. . Eclipse with a new Tomcat Project, where I built a project called Z_Webwork Tomcat Project directory structure Z_Webwork follows: Z_Webwork / work Z_Webwork / WEB-INF Z_Webwork / WEB-INF / classes Z_Webwork / WEB-INF / lib Z_Webwork / WEB-INF / SRC
2. Import% webwork_home% / webwork-2.1.jar to z_WebWork / Web-INF / LIB COPY% WebWork_HOME% / lib / core / *. Jar to z_webwork / web-inf / lib
3. Setting the Eclipse environment variable right-click on the project z_WebWork-> Properties-> java build path-> add library-> user library -> new user-defined library: webwork_lib -> add jars% webwork_home% / web-2.1.jar -> Add Jars% WebWork_Home% / lib / core / *. Jar
4. Establishing three basic profiles (1) Web.xml location in Webwork: z_webwork / web-inf / content is as follows:
XML Version = "1.0"?>
XML Version = "1.0" encoding = "ISO-8859-1">
(3) Validators.xml location: z_webwork / web-inf / src / content is as follows:
Ok, such a webwork's skeleton is well, the overall structure is as follows:
5. Here we will be in accordance Lesson 3: Actions and Results do an example ex01-index.jsp: This page is a form submitted to an action (HelloWebWorldAction) processing HelloWebWorldAction.java: inherited ActionSupport realized HelloWebWorldAction, here HelloWebWorldAction play in MVC Control ex01 -success.jsp: HelloWorldAction After successful, you will return this page here, in order to facilitate management, I am using the tutorial to build directory LESSON03 / EXAMPLE01 in Z_WebWork, and puts EX01-INDEX.JSP and EX01-SUCCESS.JSP below it The HelloWebWorldAction.java location is Z_WebWork / Web-INF / SRC / Lesson03, in the subsequent notes, all of the examples I will store the code in this structure, respectively, respectively:
//ex01-index.jsp
Click The Button Below To Activate HelloWorldAction. P>