<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0modelVersion>
<groupId>com.jege.sshgroupId>
<artifactId>struts2-spring3-hibernate3-xmlartifactId>
<version>1.0.0.RELEASEversion>
<packaging>jarpackaging>
<name>struts2-spring3-hibernate3-xmlname>
<url>http://blog.csdn.net/je_geurl>
<developers>
<developer>
<id>je_geid>
<name>je_gename>
<email>[email protected]email>
<url>http://blog.csdn.net/je_geurl>
<timezone>8timezone>
developer>
developers>
<properties>
<project.build.sourceEncoding>UTF-8project.build.sourceEncoding>
<spring.version>3.2.16.RELEASEspring.version>
<hibernate.version>3.6.5.Finalhibernate.version>
<struts.version>2.3.24struts.version>
<mysql.version>5.1.40mysql.version>
<junit.version>4.12junit.version>
<java.version>1.8java.version>
properties>
<dependencies>
<dependency>
<groupId>org.springframeworkgroupId>
<artifactId>spring-ormartifactId>
<version>${spring.version}version>
dependency>
<dependency>
<groupId>org.springframeworkgroupId>
<artifactId>spring-contextartifactId>
<version>${spring.version}version>
dependency>
<dependency>
<groupId>org.springframeworkgroupId>
<artifactId>spring-webartifactId>
<version>${spring.version}version>
dependency>
<dependency>
<groupId>org.springframeworkgroupId>
<artifactId>spring-testartifactId>
<version>${spring.version}version>
<scope>testscope>
dependency>
<dependency>
<groupId>org.hibernategroupId>
<artifactId>hibernate-coreartifactId>
<version>${hibernate.version}version>
dependency>
<dependency>
<groupId>org.hibernategroupId>
<artifactId>hibernate-entitymanagerartifactId>
<version>${hibernate.version}version>
dependency>
<dependency>
<groupId>org.apache.strutsgroupId>
<artifactId>struts2-coreartifactId>
<version>${struts.version}version>
<exclusions>
<exclusion>
<groupId>org.javassistgroupId>
<artifactId>javassistartifactId>
exclusion>
exclusions>
dependency>
<dependency>
<groupId>org.apache.strutsgroupId>
<artifactId>struts2-spring-pluginartifactId>
<version>${struts.version}version>
<exclusions>
<exclusion>
<groupId>*groupId>
<artifactId>*artifactId>
exclusion>
exclusions>
dependency>
<dependency>
<groupId>log4jgroupId>
<artifactId>log4jartifactId>
<version>1.2.15version>
<exclusions>
<exclusion>
<groupId>*groupId>
<artifactId>*artifactId>
exclusion>
exclusions>
dependency>
<dependency>
<groupId>commons-dbcpgroupId>
<artifactId>commons-dbcpartifactId>
<version>1.4version>
dependency>
<dependency>
<groupId>mysqlgroupId>
<artifactId>mysql-connector-javaartifactId>
<version>${mysql.version}version>
dependency>
<dependency>
<groupId>junitgroupId>
<artifactId>junitartifactId>
<version>${junit.version}version>
<scope>testscope>
dependency>
dependencies>
<build>
<finalName>struts2-spring3-hibernate3-xmlfinalName>
<plugins>
<plugin>
<groupId>org.apache.maven.pluginsgroupId>
<artifactId>maven-compiler-pluginartifactId>
<configuration>
<source>${java.version}source>
<target>${java.version}target>
configuration>
plugin>
<plugin>
<groupId>org.mortbay.jettygroupId>
<artifactId>jetty-maven-pluginartifactId>
<version>8.1.16.v20140903version>
<configuration>
<webAppConfig>
<contextPath>/contextPath>
webAppConfig>
configuration>
plugin>
plugins>
build>
project>
jdbc.driverClassName=com.mysql.jdbc.Driver
jdbc.username=root
jdbc.password=admin
jdbc.url=jdbc:mysql:///ssh?createDatabaseIfNotExist=true
hibernate.show_sql=true
hibernate.hbm2ddl.auto=update
hibernate.dialect=org.hibernate.dialect.MySQLDialect
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<context:property-placeholder location="classpath:jdbc.properties" />
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="${jdbc.driverClassName}" />
<property name="username" value="${jdbc.username}" />
<property name="password" value="${jdbc.password}" />
<property name="url" value="${jdbc.url}" />
bean>
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="mappingResources" value="com/jege/ssh/entity/User.hbm.xml" />
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${hibernate.dialect}prop>
<prop key="hibernate.show_sql">${hibernate.show_sql}prop>
<prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}prop>
props>
property>
bean>
<import resource="classpath:applicationContext-manager.xml" />
beans>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="userDAO" class="com.jege.ssh.dao.impl.UserDAOImpl">
<property name="sessionFactory" ref="sessionFactory" />
bean>
<bean id="userService" class="com.jege.ssh.service.impl.UserServiceImpl">
<property name="userDAO" ref="userDAO" />
bean>
<bean id="userAction" class="com.jege.ssh.action.UserAction" scope="prototype">
<property name="userService" ref="userService" />
bean>
beans>
<hibernate-mapping package="com.jege.ssh.entity">
<class name="User" table="t_user">
<id name="id">
<generator class="native" />
id>
<property name="name" />
<property name="age" />
class>
hibernate-mapping>
https://github.com/je-ge/framework