Struts2 + Hibernate + Spring (SSH) three major frameworks integrate jar packages, struts2ssh

Source: Internet
Author: User

Struts2 + Hibernate + Spring (SSH) three major frameworks integrate jar packages, struts2ssh

Struts2 + Spring3 + Hibernate3 framework integration


1. Use of each framework (build a Development Environment)
* Presentation layer framework struts2
1) jar package import: apps/struts2_balank.war contains the most basic jar package for struts2 development.
Struts2-convention-plugin-2.3.7.jar is used for struts to use annotations (if you do not use annotation development, you do not need to import)
Struts2-json-plugin-2.3.7.jar for struts2 integrated Ajax
Struts2-spring-plugin-2.3.7.jar for struts2 consolidation Spring (Consolidation spring must be imported)

2) Configure strut2 core Filter in web. xml
<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 configuration file) in the src directory)

* Service layer framework spring3
1) Import jar packages
Spring3.2 development of 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.jar
Spring Jdbc Development
Spring-jdbc-3.2.0.RELEASE.jar
Spring-tx-3.2.0.RELEASE.jar
Spring transaction management
Spring-tx-3.2.0.RELEASE.jar
Integrate Spring with other ORM frameworks (Integrate hibernate)
Spring-orm-3.2.0.RELEASE.jar
Spring is used in web
Spring-web-3.2.0.RELEASE.jar
Spring integrated Junit Testing
Spring-test-3.2.0.RELEASE.jar
(Note: Summary jar does not include c3p0 and database driver)

2) configure the web. xml listener to load the Spring Configuration
<Listener>
<! -- The WEB-INF/applicationContext. xml is loaded 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) Import jar packages
Hibernate3.jar
Required/*. jar
Hibernate-jpa-2.0-api-1.0.1.Final.jar
C3p0 + mysql driver
Integrate log4j import slf4j integrate jar package slf4j-log4j12-1.7.2.jar
(Because spring has already imported log4j and does not need to be imported again)
Level 2 Cache
Ehcache-1.5.0.jar
Commons-logging.jar
Backport-util-concurrent.jar

2) create hibernate. cfg. xml under src
3) create class name. hbm. xml in the package where the PO class is located


Integrate the jar packages required by SSH, such as hibernate33 and spring30struts20.

Struts2-spring-plugin-2.1.6.jar
Struts2-core-2.1.6.jar
Spring. jar
Spring-hibernate3.jar
Spring-core.jar
Spring-beans.jar
Spring-context.jar
Spring-jdbc.jar
Mainly these

Complete jar package of Struts2 + Spring2 + Hibernate32 framework

Create an ssh file in myeclipse to reference the package in the system. You just copy it out.
Sent.
Score

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.