The three frameworks of struts 2 + hibernate + spring (SSH) integrate jar packages

Struts 2 + spring 3 + Hibernate 3 framework integration

1. Each framework uses (development environment construction) * presentation layer framework Struts2 1) jar package import: apps / struts2_ blank. War contains the most basic jar package struts 2-convention-plugin-2.3 7.jar is used for struts using annotations (if you do not use annotations for development, you do not need to import) struts2-json-plugin-2.3.7.jar is used for struts 2 integration Ajax struts2-spring-plugin-2.3.7.jar is used for struts 2 integration spring (spring integration must be imported)

2) web. XML configuration strut2 core filter < Filter > < filter name > Struts2 < / filter name > < filter class > org apache. struts2. dispatcher. ng. filter. StrutsPrepareAndExecuteFilter



struts2


/*

3) Create struts. XML in the SRC directory XML (core configuration file)

*Business layer framework spring3 1) import jar package into spring3 2. Develop the most basic jar package spring-beans-3.2 0.RELEASE. jar spring-context-3.2. 0.RELEASE. jar spring-core-3.2. 0.RELEASE. jar spring-expression-3.2. 0.RELEASE. jar com. springsource. org. apache. commons. logging-1.1. 1.jar com. springsource. org. apache. log4j-1.2. 15. Jar AOP development spring-aop-3.2 0.RELEASE. jar spring-aspects-3.2. 0.RELEASE. jar com. springsource. org. aopalliance-1.0. 0.jar com. springsource. org. aspectj. weaver-1.6. 8.RELEASE. Spring-jdbc-3.2.jar developed by spring JDBC 0.RELEASE. jar spring-tx-3.2. 0.RELEASE. Spring-tx-3.2.jar spring transaction management 0.RELEASE. Jar spring integrates other ORM frameworks (hibernate integration) spring-orm-3.2.0.release.jar spring uses spring-web-3.2.0.release.jar spring to integrate JUnit test spring-test-3.2.0.release.jar (Note: c3p0 and database driver are not included in summary jar)

2) Configure web XML listener loading spring configuration < listener > <-- Load WEB-INF / ApplicationContext. By default xml --> org. springframework. web. context. ContextLoaderListener

contextConfigLocation classpath:applicationContext. xml

3) Create ApplicationContext under Src 4) create log4j. XML under Src properties

*hibernate3. 6 1) import the jar package into hibernate 3.0 jar required/*. jar hibernate-jpa-2.0-api-1.0. 1.Final. Jar c3p0 + MySQL driver integration log4j import slf4j integration jar package slf4j-log4j12-1.7 2. Jar (because spring has imported log4j, no need to import it again) secondary cache ehcache-1.5.0.jar commons-logging.jar backup-util-concurrent.jar

2) Create hibernate under Src cfg. XML 3) create a class name in the package where the Po class is located hbm. xml

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>