Struts Hibernate configuration problem
First of all or configure the problem, remember to introduce the package to be used in Struts and Hibernate (unclearly, you will be introduced). In terms of configuration files, Struts and Hibernate can be configured separately. Both sides do not interfere with each other, just remember that Hibernate's profile is put on the root directory of SRC (do not put it in the package, this is to generate the root of Classes Under contents).
Examples are as follows:
Web.xml:
XML Version = "1.0" encoding = "UTF-8"?>
Org.apache.struts.Action.ActionServlet
servlet-class>
init-param>
init-param>
init-param>
servlet>
servlet-maping>
http://jakarta.apache.org/struts/tags-logic
taglib-uri>
/Web-inf/tlds/struts-logic.tld
taglib-location>
taglib>
Http://jakarta.apache.org/struts/tags-html
taglib-uri>
taglib>
http://jakarta.apache.org/struts/tags-bean
taglib-uri>
taglib>
web-app>
Struts-config.xml:
XML Version = "1.0" encoding = "UTF-8"?>
form-beans>
Attribute = "form" Name = "form" PATH = "/ test" Scope = "request" TYPE = "com.ln.struts.action.testaction"> action> action-mappings> Struts-Config> Hibernate.cfg.xml: XML Version = '1.0' encoding = 'UTF-8'?>
"- // Hibernate / Hibernate Configuration DTD 2.0 // en" "http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd"> Property> Net.sf.hibernate.Dialect.MysqldiaLect Property> com.mysql.jdbc.driver Property> session-factory> Hibernate-Configuration> TableName.hmb.xml: XML Version = "1.0"?>
"- // Hibernate / Hibernate mapping DTD 2.0 // en" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"> id> clas> hibernate-maping>