Java Open Source Practice (3) -eclipse integrates with Tomcat, JBOSS
Wuder
First, prepare: Download the software:
JDK:
JDK5
IDE:
Eclispse 3.1m (Eclipse-sdk-3.1m5a-win32.zip
Plugin: jbosside (jbosside-1.4.1-jre1.5-e31.zip)
Tomcat plugin (Tomcatpluginv3.zip)
Server:
JBoss4.0 (jboss-4.0.1sp11.zip)
Tomcat5.5 (Jakarta-Tomcat-5.5.8.exe)
Second, Tomcat Web Layer Development.
1, create a project
Tomcat is a simple web container, which is very fast, suitable for the development of a simple web layer.
E.g:
There is a project in Eclispse TSS
The actual path of TSS is: "C: / Workspace / TSS"
There is a directory in the project directory TSS
The directory structure is as follows
TSS
| __ TSS
| __WEB-INF
| | | __CLASSES
| | | __LIB |
| ... .. 省 省
| __src
| __BUILD.XML
Set the Java Build Path for this project in Eclipse for Source: TSS / SRC
Default Output Folder: TSS / TSS / WEB-INF / CLASSES
2. Modify Tomcat's server.xml (Tomcat / Conf)
Add in the
DOCBASE = "C: / Workspace / TSS / TSS" Workdir = "C: / Workspace / TSS / TSS" /> 3. Run Open IE, access address is: http: // localhost: 8080 / tss / start page If you set a breakpoint in your code, the program will stop there. Press F6 to perform the next sentence, F8 is executed. Note: You need to master ANT. Third, JBoss J2EE development 1, create a project E.g: There is a project in Eclispse TSS The actual path of TSS is: "C: / Workspace / TSS" There is a directory in the project directory TSS The directory structure is as follows TSS | __ deploy | | | __TSS.WAR | | | | | __WEB-INF | | | | | | __CLASSES | | | | | | __LIB | | | ... .... 省 省 | | | | | ___ Yyejb.jar (EJB Deploy JAR) | | ... .. 省 省 | __src | __BUILD.XML Set the Java Build Path for this project in Eclipse for Source: TSS / SRC Default Output Folder: TSS / Deploy / TSS.WAR / Web-INF / CLASSES 2. Modify JBoss JBoss-Service.xml (JBoss / Server / Default / Conf) Deploy / attribute> This is changed to: attribute> 3. Run Use the right-click TTS to select "Debug" Open IE, access address is: http: // localhost: 8080 / tss / start page You can set a breakpoint in your code. Press F6 to perform the next sentence, F8 is executed. Note: You need to master Ant, XDoclet, EJBDoclet.