`
huiqinbo
  • 浏览: 344584 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

把spring和hibernate配置文件结合、和各自独立

阅读更多

有好多人喜欢把spring和hibernate配置文件结合在一起也就是配置在一个xml里如

 

 beans.xml:

 

<?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">
  <context:annotation-config/>
  <context:component-scan base-package="com"/>
  <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
     <!--数据库连接-->
     <property name="driverClassName" value="org.gjt.mm.mysql.Driver"/>
     <property name="url" value="jdbc:mysql://localhost:3306/oa1?useUnicode=true&amp;characterEncoding=UTF-8"/>
     <property name="username" value="root"/>
     <property name="password" value="root"/>
      <!-- 连接池启动时的初始值 -->
   <property name="initialSize" value="1"/>
   <!-- 连接池的最大值 -->
   <property name="maxActive" value="500"/>
   <!-- 最大空闲值.当经过一个高峰时间后,连接池可以慢慢将已经用不到的连接慢慢释放一部分,一直减少到maxIdle为止 -->
   <property name="maxIdle" value="2"/>
   <!--  最小空闲值.当空闲的连接数少于阀值时,连接池就会预申请去一些连接,以免洪峰来时来不及申请 -->
   <property name="minIdle" value="1"/>
   </bean>
  
 <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
      <property name="dataSource" ref="dataSource"/>
     
   <property name="mappingResources">
      <list>
       
        <value>com/nqyw/oa/bean/Person.hbm.xml</value>
        <value>com/nqyw/oa/bean/Organization.hbm.xml</value>
        <value>com/nqyw/oa/bean/Module.hbm.xml</value>
        <value>com/nqyw/oa/bean/Acl.hbm.xml</value>
        <value>com/nqyw/oa/bean/Role.hbm.xml</value>
        <value>com/nqyw/oa/bean/User.hbm.xml</value>
        <value>com/nqyw/oa/bean/UsersRoles.hbm.xml</value>
        <value>com/nqyw/oa/bean/ApproveInfo.hbm.xml</value>
        <value>com/nqyw/oa/bean/Document.hbm.xml</value>
        <value>com/nqyw/oa/bean/Workflow.hbm.xml</value>
      </list>
   </property>
   <!-- 原先的配置路径 <property name="mappingDirectoryLocations">
       <list>
               <value>classpath:com/nqyw/oa/bean/</value>
             </list>
   </property>-->
   <!-- hibernate属性信息 -->
      <property name="hibernateProperties">
      <value>
          hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
          hibernate.hbm2ddl.auto=update
          hibernate.show_sql=true
          hibernate.format_sql=false
          hibernate.cache.use_second_level_cache=true
                hibernate.cache.use_query_cache=false
             hibernate.cache.provider_class=org.hibernate.cache.EhCacheProvider
        </value>
      </property>
 </bean>
 
 <!-- 配置事务管理 -->
 <bean id="txManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
    <property name="sessionFactory" ref="sessionFactory"/>
 </bean>
 <!-- 事务声明采用注解方式 -->
 <tx:annotation-driven transaction-manager="txManager"/>
 <!-- 这里都是为了测试用的和持久层和业务层没有关系 -->
    <bean id="personService" class="com.nqyw.oa.service.imp.PersonServiceBean"></bean>
    <bean id="organizationService" class="com.nqyw.oa.service.imp.OrganizationServiceBean"></bean>
    <bean id="moduleService" class="com.nqyw.oa.service.imp.ModuleServiceBean"></bean>
    <bean id="roleService" class="com.nqyw.oa.service.imp.RoleServiceBean"></bean>
   
    <bean id="initSystemDatas" class="com.nqyw.oa.service.imp.InitSystemDatasImpl"></bean>
   
    <bean id="aclManager" class="com.nqyw.oa.service.imp.AclServiceBean"></bean>
    <bean id="myfunctions" class="com.nqyw.oa.web.action.MyFunctions">
         <property name="aclManager" ref="aclManager"></property>
    </bean>
   
 
</beans>

 

 

 

一旦想让两个配置文件各自独立就不会了,现在回钦波帮你:如:

1. beans.xml

<?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">
  <context:annotation-config/>
  <context:component-scan base-package="com"/>
  <!-- 配置sessionFactory -->
 <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
  <property name="configLocation">
   <value>classpath:hibernate.cfg.xml</value>
  </property>
 </bean> 
 
 <!-- 配置事务管理 -->
 <bean id="txManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
    <property name="sessionFactory" ref="sessionFactory"/>
 </bean>
 <!-- 事务声明采用注解方式 -->
 <tx:annotation-driven transaction-manager="txManager"/>
 <!-- 这里都是为了测试用的和持久层和业务层没有关系 -->
    <bean id="personService" class="com.nqyw.oa.service.imp.PersonServiceBean"></bean>
    <bean id="organizationService" class="com.nqyw.oa.service.imp.OrganizationServiceBean"></bean>
    <bean id="moduleService" class="com.nqyw.oa.service.imp.ModuleServiceBean"></bean>
    <bean id="roleService" class="com.nqyw.oa.service.imp.RoleServiceBean"></bean>
   
    <bean id="initSystemDatas" class="com.nqyw.oa.service.imp.InitSystemDatasImpl"></bean>
   
    <bean id="aclManager" class="com.nqyw.oa.service.imp.AclServiceBean"></bean>
    <bean id="myfunctions" class="com.nqyw.oa.web.action.MyFunctions">
         <property name="aclManager" ref="aclManager"></property>
    </bean>
   
 
</beans>

 

2. hibernate.config.xml

 

<?xml version='1.0' encoding='utf-8'?>

<!DOCTYPE hibernate-configuration PUBLIC
          "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
          "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
  <session-factory>

    <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
    <property name="hibernate.connection.url">jdbc:mysql://127.0.0.1/oa?useUnicode=true&amp;characterEncoding=UTF-8</property>
    <property name="hibernate.connection.username">root</property>
    <property name="hibernate.connection.password">123456</property>
    <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
   
    <property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
   
    <property name="hibernate.show_sql">false</property>
   
    <property name="hibernate.hbm2ddl.auto">update</property>
   
   
   
    <mapping resource="com/nqyw/oa/bean/Person.hbm.xml"/>
    <mapping resource="com/nqyw/oa/bean/Organization.hbm.xml"/>
    <mapping resource="com/nqyw/oa/bean/Module.hbm.xml"/>
    <mapping resource="com/nqyw/oa/bean/Acl.hbm.xml"/>
    <mapping resource="com/nqyw/oa/bean/Role.hbm.xml"/>
    <mapping resource="com/nqyw/oa/bean/User.hbm.xml"/>
    <mapping resource="com/nqyw/oa/bean/UsersRoles.hbm.xml"/>
    <mapping resource="com/nqyw/oa/bean/ApproveInfo.hbm.xml"/>
    <mapping resource="com/nqyw/oa/bean/Document.hbm.xml"/>
    <mapping resource="com/nqyw/oa/bean/Workflow.hbm.xml"/>
    <mapping resource="com/bjsxt/jbpm/DocumentTest.hbm.xml"/>
   
   
   
   
   
   
   
    <!-- DataSource properties (begin) ===
    <property name="hibernate.connection.datasource">java:/JbpmDS</property>
    ==== DataSource properties (end) -->
   
    <!-- JTA transaction properties (begin) ===
    <property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
    <property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>
    ==== JTA transaction properties (end) -->

    <!-- CMT transaction properties (begin) ===
    <property name="hibernate.transaction.factory_class">org.hibernate.transaction.CMTTransactionFactory</property>
    <property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>
    ==== CMT transaction properties (end) -->

    <!-- logging properties (begin) ===
    <property name="hibernate.show_sql">true</property>
    <property name="hibernate.format_sql">true</property>
    <property name="hibernate.use_sql_comments">true</property>
    ==== logging properties (end) -->
   
    <!-- ############################################ -->
    <!-- # mapping files with external dependencies # -->
    <!-- ############################################ -->

    <!-- following mapping file has a dependendy on   -->
    <!-- 'bsh-{version}.jar'.                         -->
    <!-- uncomment this if you don't have bsh on your -->
    <!-- classpath.  you won't be able to use the     -->
    <!-- script element in process definition files   -->
    <mapping resource="org/jbpm/graph/action/Script.hbm.xml"/>

    <!-- following mapping files have a dependendy on  -->
    <!-- 'jbpm-identity.jar', mapping files            -->
    <!-- of the pluggable jbpm identity component.     -->
    <!-- Uncomment the following 3 lines if you        -->
    <!-- want to use the jBPM identity mgmgt           -->
    <!-- component.                                    -->
    <!-- identity mappings (begin) -->
    <mapping resource="org/jbpm/identity/User.hbm.xml"/>
    <mapping resource="org/jbpm/identity/Group.hbm.xml"/>
    <mapping resource="org/jbpm/identity/Membership.hbm.xml"/>
    <!-- identity mappings (end) -->
   
    <!-- following mapping files have a dependendy on  -->
    <!-- the JCR API                                   -->
    <!-- jcr mappings (begin) ===
    <mapping resource="org/jbpm/context/exe/variableinstance/JcrNodeInstance.hbm.xml"/>
    ==== jcr mappings (end) -->


    <!-- ###################### -->
    <!-- # jbpm mapping files # -->
    <!-- ###################### -->

    <!-- hql queries and type defs -->
    <mapping resource="org/jbpm/db/hibernate.queries.hbm.xml" />
   
    <!-- graph.def mapping files -->
    <mapping resource="org/jbpm/graph/def/ProcessDefinition.hbm.xml"/>
    <mapping resource="org/jbpm/graph/def/Node.hbm.xml"/>
    <mapping resource="org/jbpm/graph/def/Transition.hbm.xml"/>
    <mapping resource="org/jbpm/graph/def/Event.hbm.xml"/>
    <mapping resource="org/jbpm/graph/def/Action.hbm.xml"/>
    <mapping resource="org/jbpm/graph/def/SuperState.hbm.xml"/>
    <mapping resource="org/jbpm/graph/def/ExceptionHandler.hbm.xml"/>
    <mapping resource="org/jbpm/instantiation/Delegation.hbm.xml"/>

    <!-- graph.node mapping files -->
    <mapping resource="org/jbpm/graph/node/StartState.hbm.xml"/>
    <mapping resource="org/jbpm/graph/node/EndState.hbm.xml"/>
    <mapping resource="org/jbpm/graph/node/ProcessState.hbm.xml"/>
    <mapping resource="org/jbpm/graph/node/Decision.hbm.xml"/>
    <mapping resource="org/jbpm/graph/node/Fork.hbm.xml"/>
    <mapping resource="org/jbpm/graph/node/Join.hbm.xml"/>
    <mapping resource="org/jbpm/graph/node/State.hbm.xml"/>
    <mapping resource="org/jbpm/graph/node/TaskNode.hbm.xml"/>

    <!-- context.def mapping files -->
    <mapping resource="org/jbpm/context/def/ContextDefinition.hbm.xml"/>
    <mapping resource="org/jbpm/context/def/VariableAccess.hbm.xml"/>

    <!-- taskmgmt.def mapping files -->
    <mapping resource="org/jbpm/taskmgmt/def/TaskMgmtDefinition.hbm.xml"/>
    <mapping resource="org/jbpm/taskmgmt/def/Swimlane.hbm.xml"/>
    <mapping resource="org/jbpm/taskmgmt/def/Task.hbm.xml"/>
    <mapping resource="org/jbpm/taskmgmt/def/TaskController.hbm.xml"/>

    <!-- module.def mapping files -->
    <mapping resource="org/jbpm/module/def/ModuleDefinition.hbm.xml"/>

    <!-- bytes mapping files -->
    <mapping resource="org/jbpm/bytes/ByteArray.hbm.xml"/>

    <!-- file.def mapping files -->
    <mapping resource="org/jbpm/file/def/FileDefinition.hbm.xml"/>

    <!-- scheduler.def mapping files -->
    <mapping resource="org/jbpm/scheduler/def/CreateTimerAction.hbm.xml"/>
    <mapping resource="org/jbpm/scheduler/def/CancelTimerAction.hbm.xml"/>

    <!-- graph.exe mapping files -->
    <mapping resource="org/jbpm/graph/exe/Comment.hbm.xml"/>
    <mapping resource="org/jbpm/graph/exe/ProcessInstance.hbm.xml"/>
    <mapping resource="org/jbpm/graph/exe/Token.hbm.xml"/>
    <mapping resource="org/jbpm/graph/exe/RuntimeAction.hbm.xml"/>

    <!-- module.exe mapping files -->
    <mapping resource="org/jbpm/module/exe/ModuleInstance.hbm.xml"/>
       
    <!-- context.exe mapping files -->
    <mapping resource="org/jbpm/context/exe/ContextInstance.hbm.xml"/>
    <mapping resource="org/jbpm/context/exe/TokenVariableMap.hbm.xml"/>
    <mapping resource="org/jbpm/context/exe/VariableInstance.hbm.xml"/>
    <mapping resource="org/jbpm/context/exe/variableinstance/ByteArrayInstance.hbm.xml"/>
    <mapping resource="org/jbpm/context/exe/variableinstance/DateInstance.hbm.xml"/>
    <mapping resource="org/jbpm/context/exe/variableinstance/DoubleInstance.hbm.xml"/>
    <mapping resource="org/jbpm/context/exe/variableinstance/HibernateLongInstance.hbm.xml"/>
    <mapping resource="org/jbpm/context/exe/variableinstance/HibernateStringInstance.hbm.xml"/>
    <mapping resource="org/jbpm/context/exe/variableinstance/LongInstance.hbm.xml"/>
    <mapping resource="org/jbpm/context/exe/variableinstance/NullInstance.hbm.xml"/>
    <mapping resource="org/jbpm/context/exe/variableinstance/StringInstance.hbm.xml"/>

    <!-- job mapping files -->
    <mapping resource="org/jbpm/job/Job.hbm.xml"/>
    <mapping resource="org/jbpm/job/Timer.hbm.xml"/>
    <mapping resource="org/jbpm/job/ExecuteNodeJob.hbm.xml"/>
    <mapping resource="org/jbpm/job/ExecuteActionJob.hbm.xml"/>

    <!-- taskmgmt.exe mapping files -->
    <mapping resource="org/jbpm/taskmgmt/exe/TaskMgmtInstance.hbm.xml"/>
    <mapping resource="org/jbpm/taskmgmt/exe/TaskInstance.hbm.xml"/>
    <mapping resource="org/jbpm/taskmgmt/exe/PooledActor.hbm.xml"/>
    <mapping resource="org/jbpm/taskmgmt/exe/SwimlaneInstance.hbm.xml"/>

    <!-- logging mapping files -->
    <mapping resource="org/jbpm/logging/log/ProcessLog.hbm.xml"/>
    <mapping resource="org/jbpm/logging/log/MessageLog.hbm.xml"/>
    <mapping resource="org/jbpm/logging/log/CompositeLog.hbm.xml"/>
    <mapping resource="org/jbpm/graph/log/ActionLog.hbm.xml"/>
    <mapping resource="org/jbpm/graph/log/NodeLog.hbm.xml"/>
    <mapping resource="org/jbpm/graph/log/ProcessInstanceCreateLog.hbm.xml"/>
    <mapping resource="org/jbpm/graph/log/ProcessInstanceEndLog.hbm.xml"/>
    <mapping resource="org/jbpm/graph/log/ProcessStateLog.hbm.xml"/>
    <mapping resource="org/jbpm/graph/log/SignalLog.hbm.xml"/>
    <mapping resource="org/jbpm/graph/log/TokenCreateLog.hbm.xml"/>
    <mapping resource="org/jbpm/graph/log/TokenEndLog.hbm.xml"/>
    <mapping resource="org/jbpm/graph/log/TransitionLog.hbm.xml"/>
    <mapping resource="org/jbpm/context/log/VariableLog.hbm.xml"/>
    <mapping resource="org/jbpm/context/log/VariableCreateLog.hbm.xml"/>
    <mapping resource="org/jbpm/context/log/VariableDeleteLog.hbm.xml"/>
    <mapping resource="org/jbpm/context/log/VariableUpdateLog.hbm.xml"/>
    <mapping resource="org/jbpm/context/log/variableinstance/ByteArrayUpdateLog.hbm.xml"/>
    <mapping resource="org/jbpm/context/log/variableinstance/DateUpdateLog.hbm.xml"/>
    <mapping resource="org/jbpm/context/log/variableinstance/DoubleUpdateLog.hbm.xml"/>
    <mapping resource="org/jbpm/context/log/variableinstance/HibernateLongUpdateLog.hbm.xml"/>
    <mapping resource="org/jbpm/context/log/variableinstance/HibernateStringUpdateLog.hbm.xml"/>
    <mapping resource="org/jbpm/context/log/variableinstance/LongUpdateLog.hbm.xml"/>
    <mapping resource="org/jbpm/context/log/variableinstance/StringUpdateLog.hbm.xml"/>
    <mapping resource="org/jbpm/taskmgmt/log/TaskLog.hbm.xml"/>
    <mapping resource="org/jbpm/taskmgmt/log/TaskCreateLog.hbm.xml"/>
    <mapping resource="org/jbpm/taskmgmt/log/TaskAssignLog.hbm.xml"/>
    <mapping resource="org/jbpm/taskmgmt/log/TaskEndLog.hbm.xml"/>
    <mapping resource="org/jbpm/taskmgmt/log/SwimlaneLog.hbm.xml"/>
    <mapping resource="org/jbpm/taskmgmt/log/SwimlaneCreateLog.hbm.xml"/>
    <mapping resource="org/jbpm/taskmgmt/log/SwimlaneAssignLog.hbm.xml"/>
   
  </session-factory>
</hibernate-configuration>

0
1
分享到:
评论

相关推荐

    Struts+spring+hibernate教程

    Struts、Spring 和 Hibernate 是Java Web开发中的三大框架,它们各自负责不同的职责,共同构建了企业级应用的基础架构。在本教程中,你将学习如何整合这三个强大的工具,以实现高效且灵活的后端开发。 Struts 是一...

    spring struts hibernate 项目

    4. 配置Hibernate:编写实体类,配置Hibernate的主配置文件(hibernate.cfg.xml)和映射文件(.hbm.xml)。 5. 配置DBCP:设置数据库连接池的属性,如driverClassName、url、username、password等。 在实际项目开发...

    WebWork.Spring.Hibernate整合开发网络书城.第四讲.rar

    在"A074]WebWork+Spring+Hibernate整合开发网络书城 第四讲(JustCode原创).wrf"这个文件中,我们可以期待看到具体的整合步骤、配置文件解析以及案例演示。这可能包括Spring如何作为容器管理WebWork的动作类,以及...

    StrutsSpringHibernate开发需求包.rar

    这个"StrutsSpringHibernate开发需求包"很可能是为了帮助开发者在项目中快速集成这三个框架而准备的。 首先,让我们来详细了解一下这三个框架: 1. **Struts**:这是一个基于MVC(Model-View-Controller)设计模式...

    Struts2+Hibernate+Spring入门教程

    在“Struts2+Spring2+Hibernate3 web应用示例.doc”文档中,你可能会找到关于如何配置这三大框架的详细步骤,包括web.xml、struts.xml、spring配置文件(如applicationContext.xml)和hibernate配置文件(如...

    Struts2,Spring,Hibernate 开发入行真功夫源码

    Struts2、Spring和Hibernate是Java开发中三大主流框架,它们各自解决着应用程序的不同问题,共同构建了企业级Java应用的基础架构。理解并熟练运用这三个框架是成为一名合格的Java开发者的关键。 **Struts2框架**是...

    Spring-Struts-Hibernate在maven下整合

    **Spring-Struts-Hibernate ...通过这个整合,开发者可以享受到Spring、Struts2和Hibernate各自的优势,并通过Maven进行高效的项目管理。这种架构对于大型、复杂的Java Web应用来说,提供了良好的可维护性和扩展性。

    Struts+Hibernate+Spring面试题合集及答案常见题目经典精选汇总大全.docx

    - Hibernate工作原理主要包括读取配置文件和映射信息,创建SessionFactory,然后通过SessionFactory打开Session,执行持久化操作,最后提交事务和关闭Session。 - Hibernate的并发机制主要涉及Session的非线程安全...

    Spring+Struts+Hibernate

    这些框架各自解决了不同的问题,Spring关注于依赖注入和面向切面编程,Struts处理MVC(模型-视图-控制器)架构,而Hibernate则负责持久化层,简化数据库操作。 **Spring框架** 是一个全面的后端开发框架,其核心...

    struts2+spring2.5+hibernate3 的中文api(PDF)

    Struts2、Spring2.5和Hibernate3是Java开发领域中的三大开源框架,它们各自扮演着不同的角色,共同构建了一个强大的企业级应用解决方案。这里,我们深入探讨这三大框架的核心功能和结合使用的方式。 **Struts2** 是...

    ssh(spring5+struts2+hibernate5)整合空项目,拿来直接填项目

    然而,由于SSH各自独立的配置和大量的XML配置文件,项目的复杂度也相对较高。因此,在实际开发中,开发者可能转向Spring Boot这样的现代框架,它以更简洁的方式实现了类似的功能,降低了项目初始化和维护的成本。 ...

    Struts+Hibernate+Spring

    2. **Struts框架**:掌握Struts的配置文件struts-config.xml,Action类的编写,以及如何使用ActionForm对象传递请求数据。 3. **Servlet和JavaBeans**:了解Servlet的基础知识,包括如何编写和映射Servlet,以及...

    struts hibernate spring 全注解开发框架

    Struts、Hibernate和Spring是Java开发中的三大框架,它们各自承担着不同的职责并协同工作,以提高开发效率和代码质量。在本项目中,我们使用的是Struts2.1.6、Spring2.5.6和Hibernate3.3的老版本,尽管这些版本相对...

    spring经典小案例

    1. 配置Spring:创建一个Spring配置文件(如`applicationContext.xml`),声明数据库连接池、SessionFactory、Hibernate的DAO和Service类等。 2. 整合Hibernate:在Spring配置文件中,配置Hibernate的...

    Struts Hibernate Spring 集成开发宝典 blog

    Struts、Hibernate 和 Spring 是Java Web开发中的三大框架,它们各自负责不同的职责,共同构建了一个高效、可维护的Web应用程序架构。Struts处理MVC(Model-View-Controller)架构,Hibernate专注于对象关系映射...

    Struts2.0+Hibernate+Spring(二)

    总的来说,Struts2.0、Hibernate和Spring的结合为Java Web开发提供了一个强大而灵活的解决方案,它们各自专注于不同的职责,共同构建出高效、可维护的后端系统。理解并熟练掌握这三大框架的使用,对于提升Java开发者...

    Spring + Struts + Hibernate 的完整 MyEclipse 项目源码

    1. **依赖注入**:Spring通过配置文件或注解来管理对象之间的依赖关系,使得代码更加松耦合,易于测试和维护。 2. **事务管理**:Spring提供了声明式事务管理,开发者可以在不编写具体事务管理代码的情况下,通过...

    Struts+Hibernate+Spring.ppt

    Struts、Hibernate和Spring是Java Web开发中的三大主流框架,它们各自负责Web应用的不同层面,共同构建出高效、可扩展的系统。Struts是一个MVC(Model-View-Controller)框架,专注于处理用户请求和控制应用程序流程...

    struts_hibernate_spring中文文档

    Struts、Hibernate和Spring是Java开发中的三大框架,它们各自解决不同的问题,组合使用能构建出高效、可维护的企业级Web应用。以下是对这三大框架的详细解释。 **Struts** 是一个开源的MVC(Model-View-Controller...

    Spring4.2_Struts2_Hibernate4.3框架整合

    本项目"Spring4.2_Struts2_Hibernate4.3框架整合"旨在演示如何将Spring 4.2、Struts2和Hibernate 4.3这三大流行Java Web框架结合使用。这些框架各自在应用开发中扮演着重要的角色:Spring提供了依赖注入和面向切面...

Global site tag (gtag.js) - Google Analytics