First, the environment is built
a) JDK: Some tools are running on this platform, and some tools come with JDK.
http://java.sun.com/j2se/1.4.2/download.html
b) Eclipse: Java's IDE development tool.
http://www.eclipse.org
c) Struts: Struts Development Kit.
http://struts.apache.org/
d) Tomcat: web server for testing, publishing a web application.
http://jakarta.apache.org/tomcat/index.html
e) ANT: Based on Java build tool.
http://ant.apache.org/
f) Several commonly used Eclipse plugins:
Lomboz, Xmlbuddy, Checkstyle, Tomcat, EMF-SDO-Runtime
Second, the configuration development environment
a) Set an environment variable
Java_Home, Tomcat_Home, Ant_home
Add% java_home% / bin,% Tomcat_Home% / bin,% ant_home% / bin
b) Configure the Lomboz plugin
Set the "JKD Tools.jar:", "Server Definitions" option for the Lomboz plugin
c) Configure Tomcat plugin
Set the Tomcat Version, "Tomcat Home", "Tomcat Home" option of Tomcat plugin, "JVM Settings" option
The JRE specified in "JVM Settings" must be the path to JDK.
Third, test development environment
a) New Lomboz J2EE Project project, named TEST
b) Next, next step
c) Add MODULE in Web Modules, namely Mytest
d) Select Add a web server in TargeTed Servers, here chooses Apache Tomcat V5.0.x
e) Add a Source Folder after completion, name to SRC
f) Set the output path of the TEST project to test / mytest / web-inf / classes
g) Open Lomboz J2EE View, Deploy MyTest
h) Start Tomcat, open the browser to enter http: // localhost: 8080 / mytest
i) Show welcome
Four, Based on Struts HelloWorld
a) Copy the * .jar file under the STRUTS development kit lib directory to the test / mytest / web-inf / lib directory
b) Copy the * .dtd, *. TLD, * .xml file under the STRUTS development kit lib directory to TEST / MyTest / Web-INF / Directory
c) Right click on MyTest, select the add-web-inf / lib jars to classpath option in Lomboz J2EE.
d) Edit Web.xml file, add code:
Org.apache.struts.Action.ActionServlet
servlet-class>
/Web-inf/struts-config.xml
param-value>
init-param>
servlet>
servlet-maping>
e) New struts-config.xml file, add code:
XML Version = "1.0" encoding = "UTF-8"?>
PATH = "/ my" Forward = "/ helloworld.jsp" /> action-mappings> ContentType = "text / html" /> Struts-Config> f) New HelloWorld.JSP file, enter helloworld and so on in Body g) Re-deploy mytest h) Open the browser to enter http: // localhost: 8080 / mytest / my.do i) Show HelloWorld and other content