Step: 6. Next We want to add Struts configuration in the Project configuration document, because this is not the setting with xdoclets, so we want to do it once, but it's just once. First we will explode 'Struts-Validator For all files / Web-INF / All files after. WEB-INF / INF / INTMIT, all copies in tutorial / src / web-INF / data clip. Add four XML files in Tutorial / SRC / Web-INF /, 'servlets.xml', 'servlet-mappings.xml', 'taglibs.xml' And 'struts-plugins.xml': l servlets.xml documentation is as follows:
l servlet-mapping.xml documentation is as follows:
Action servlet-name>
*. do url-pattern>
servlet-mapping> L taglibs.xml document content is as follows
/web-inf/struts-bean.tld taglib-uri>
/web-inf/struts-bean.tld taglib-location>
taglib>
/web-inf/struts-html.tld taglib-uri>
/web-inf/struts-html.tld taglib-location>
taglib>
/web-inf/struts-logic.tld taglib-uri>
/web-inf/struts-logic.tld taglib-location>
taglib>
l struts-plugins.xml documentation The content is as follows plug-in> follows the settings to be added to the XDoclet in JBoss-IDE, right-click Tutorial Project -> 'Properties' -> 'XDoclet Configurations' selected 'mergedir' = 'SRC / Web-INF', then in 'XDoclet Configurations' -> 'Web' -> 'WebDoclet', right-click 'add' -> 'strutsconfigxml' (select Version = 1.1), then add 'strutsvalidationXML' (no Select any options), then add 'fileset', select 'Dir' = 'src', select 'incdude' = '** / * form.java', then add 'fileset', select 'Dir' = 'src', Choose 'incrudes' = '** / * action.java', as shown below: 7 After the steps of the above pain, you can run xdoclet, right-click Tutorial Project -> 'Run XDoclet', you can see it after successful running. There is' servlets.xml ',' taglibs.xml 'and' servlet-mappings.xml 'in' Web.xml ', and' computeform ',' ComputeAction 'and' Struts in 'Struts-Config.xml'. Plugins.xml 'information, will also add a' validation.xml 'document, which proves to be successful!
8 When you add 'index.jsp', add 'index.jsp' document under 'DOCROOT', the details are as follows: <% @ page contenttype = "text / html; charset = UTF-8" Language = "Java"%>
To simplify the program, I don't display an incorrect message when entering an error (no numbers that are not entered or entered), the program will only return to index.jsp.
9 Now we can try to run, first build project -> Run XDCOLET -> Run Packaging -> Deploy 'FIBOAPPP.EAR' to JBoss, in Browser Enter 'http://127.0.0.1:8080/fibo/index.jsp ', Enter' 15 ', you can see the following results, as the example in the JBoss-Ide tutorial, but the Struts function is used.
Postscript: This example spent almost two days, sometimes XDoclets can't produce Form Bean configuration information in struts-config.xml, and later deleted struts-config.xml to resolve the problem again. When I have a few times of xdoclet, Eclipse will have a warning for Memory, because JBoss-IDE has eclipse and jboss, and it is not too stable during processing. I don't know if Eclipse 3.0 is improved. Ok, I have time, I have time. Write how to use Hibernate in JBoss-IDE, or may translate some JBoss-IDE documents. Finally, this section is small, there may be a lot of places to go wrong or omissions, I hope everyone can correct and give opinions, thank you!