Spring+struts+hibernate Getting Started example wiring step by step
Source: Internet
Author: User
Wiring Download Point Http://www.onjava.com/onjava/2004/04/07/examples/wiring.zip
Say the point, mainly pay attention to a few points!
One prophase work 1. Download Xdoclet,db2java and Proxool, and copy the. Jar under the Proxool Lib directory to the Lib directory under wiring Web-inf. The corresponding spring,hibernate,struts to use the package is also copied into the Lib directory, such as aopalliance.jar; cglib-full-2.0.2.jarr;commons-beanutils.jar; ommons-collections.jar;commons-digester.jar; Commons-lang.jar;commons-logging.jar ; commons-validator.jar;dom4j.jar; ehcache.jar;hibernate2.jar; Jakarta-oro.jar;jstl.jar; Jta.jar;log4j.jar; odmg.jar;spring.jar standard.jar;struts.jar; struts-el.jar
Two about BUILD.XML1. The first few paragraphs <property name= "xdoclet.lib.home" value= "E:/xdoclet122/lib"/> <property name= "Properties.dir" value= " ./classes "/> <property name= hibernate.lib.home" value= "E:/hibernate212/lib"/> <property name= " War.webinf.home "value=" E:/tomcat5.0/webapps/wiring/web-inf "/> <property name=" mysql.lib.home "value=" e:/ Mysqldriver "/> <property name= db2.lib.home" value= "E:/db2java/db2java/lib"/> <property name= " Tomcat.work.directory "value=" E:/tomcat5.0/work "/> To change the corresponding value to your own corresponding file directory
2. In this section <!--Execute the Hibernatedoclet task--><fileset dir= "${war.webinf.home} ource" ><!--this location, Fileset, the back of your Java source program is located in the directory, the original directory is wrong! <include name= "**/bo/*.java"/> </fileset>3. In <target name= "Db-schema" ... This section of the <java classname= "Net.sf.hibernate.tool.hbm2ddl.SchemaExport" fork= "true" .... , see the following argument that line <arg....<arg line= "${hibernate.mappings}--text--format--output=clientportal_schema.ddl-- Properties=${war.webinf.home}/classes/hibernate.properties "/> Notice the properties here, the original XML file is not, This indicates where your hibernate.properties is located. 4. Similarly, in <target name= "Db-schema-drop" ... The corresponding position in this paragraph should also be added properties=......hibernate.properties this sentence
Three about applicationcontext-hibernate.xml this inside just change a sentence <prop key= "Hibernate.proxool.xml" >proxool.xml</prop> Under Web-inf, there is a proxool.xml configuration file that indicates the corresponding configuration of the connection pool, which indicates where your proxool.xml is located.
Four about Proxool and hibernate.properties nothing to say, everybody will!
Five web.xml is actually wrong??? See the Actionservlet configuration section, initialize the parameters <param-value>/WEB-INF/struts-config.xml</param-value> The original Web.xml Web-inf before incredibly no "/" Symbol! Alas, another confusion!!!
Six to note that all the file name can not have spaces, this is because in the line of ARG lines, the "" space as a separator, read only the data in front of the space, so that can not correctly explain hibernate.mappings this parameter, which puzzled me for a long time.
71 Point Experience Java configuration is indeed a bit of trouble, especially for my novice, this time to solve the configuration problem, so that I understand the "wool out of the sheep" truth. Write down this article to configure the person! I am glad that I can have a interest in open source, although not fanatical, But I also enjoy it. The talent!!!
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.