JBoss-IDE 1.2.2 Introduction (Struts) 1:
First require:
l To complete the JBoss-IDE 1.2.2 profile (STATELESS SESSION bean), and the example in successful running, Fibobobean and ComputeServlet
l There must be a certain understanding and download struts 1.1 and xdoclets for Struts.
Description:
l I will continue to reuse the example in the JBoss-IDE tutorial, which is a INDEX.html Call ComputeServlet re-invoke Fibobean FUNCTION (Compute). After applying to Struts, I will use a index.jsp with a computeform. Call ComputeAction, and computection will call Call computeServlet, ComputeServlet re-invoke fibobean. Mid multiple transit and in Index.jsp plus Struts data input check.
step:
1. Download Struts 1.1 to explode it, I will use the 'struts-Validator.war' file in the WebApps in it, then explode the 'struts-validator.war', copy the LIB folder in its web-infers. Passed on SRC / Web-Inf in Tutorial, finally seeing nine Struts JAR files in Tutorial / SRC / Web-INF / LIB. After the XDoclet, download it, copy it, copy its lib data clip 'xdoclet-apache-module-1.2b4.jar' into the /plipse/org.jboss.ide.eclipse.xdoclet.core_1.2.2/ in the Eclipse folder, because this is an additional module in xdoclet, so remember In the JBoss-IDE's XDoclet Configure refresh, XDoclet modules and Data.
2. Use eclipse (I use 2.1) to open the Tutorial's Project, right-click Tutorial Project, select 'Properties'.
Then select 'Java Build Path' -> 'Libraries' -> 'Add External Jars', select 'Lib' in Project Folder, select 'struts.jar' and 'Commons-Validator.jar', press 'Open' and press again. 'Ok'.
3. JBoss-IDE is a good place to use Templates on XDoclet. JBoss-IDE already contains stateless session ejb, servlet, ..., and more. We can create a template to Struts Form, one gives Struts Action First, 'window' -> 'preferences' in the Eclipse tool column, select 'XDoclet' -> 'Code Assist' -> Templates 'in' JBoss IDE ', right-click' add trees, fill in the right hand side window Into 'struts form', right click on 'Struts Form' to select 'add' -> 'struts' Add to' form: class', then select 'Extends',' Implements' and 'Name'. And Struts Action 'is almost the same Refer to the following figure.