d="personService" class="com.persia.service.impl.PersonServiceImpl"></bean> <!--注入Struts 2的action --><bean id="personList" class="com.persia.struts2.action.PersonListAction"></bean></beans>6.SSJ:<?xml version="1.0" encoding="UTF-8"?><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" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd "> <!-- 使用手工配置的注解方式来注入bean --><context:annotation-config></context:annotation-config> <!-- 1.配置Spring集成JPA --><bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean"> <property name="persistenceUnitName" value="SpringJPAPU"/></bean> <!--2.配置Spring针对JPA的事务 --> <bean id="txManager" class="org.springframework.orm.jpa.JpaTransactionManager"> <property name="entityManagerFactory" ref="entityManagerFactory"/></bean> <!--3.开启事务注解 --><tx:annotation-driven transaction-manager="txManager"/> <!--以上3个Spring集成JPA的配置,在web项目先添加Spring支持,后添加JPA支持时会自动生成 --> <!-- 配置业务bean --><bean id="personService" class="com.persia.service.impl.PersonServiceImpl"></bean> <!-- 配置Struts的action --><bean name="/person/list" class="com.persia.struts.PersonListAction"/><bean name="/person/manage" class="com.persia.struts.PersonManageAction"/></beans>