Struts2 + Spring3 + Hibernate3 Framework Integration
1. Use of each frame (development environment construction)
* Presentation Layer Frame STRUTS2
1) Jar Package import: Apps/struts2_blank.war contains struts2 to develop the most basic jar package
Struts2-convention-plugin-2.3.7.jar for struts using annotations (if not developed with annotations, no import required)
Struts2-json-plugin-2.3.7.jar for STRUTS2 Integrated Ajax
Struts2-spring-plugin-2.3.7.jar for STRUTS2 Integration Spring (integrated spring must be imported)
2) Web. XML Config Strut2 core filter
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
3) Create Struts.xml (core profile) in SRC directory
2) Configure the Web. XML listener to load the spring configuration
<listener>
<!--load Web-inf/applicationcontext.xml by default--
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param>
3) Create applicationcontext.xml under SRC
4) Create log4j.properties under SRC
*hibernate3.6
1) Jar Package Import
Hibernate3.jar
Required/*.jar
Hibernate-jpa-2.0-api-1.0.1.final.jar
C3P0 + MySQL Driver
Integrated log4j import SLF4J integrated jar package Slf4j-log4j12-1.7.2.jar
(because spring has been imported log4j no need to import again)
Second-level cache
Ehcache-1.5.0.jar
Commons-logging.jar
Backport-util-concurrent.jar
2) Create hibernate.cfg.xml under SRC
3) Create the class name in the package where the PO class is located. hbm.xml