B/S程序中引入Sping2.5主要涉及什么步骤

1. 加入spring的基本jar包

 

    spring.jar
    spring-webmvc.jar
    spring-webmvc-struts.jar
2. 加入spring的依赖包

 

 

    commons-logging.jar
3. 在WEB-INF目录下建立applicationContext.xml,如

 

 

代码: 全选

 

<!---->

<beans xmlns="http://www.springframework.org/schema/beans" <="" p="">

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-2.5.xsd">

<bean id="d1" class="main.Dao1Impl"></bean>

</beans>

 

 

4. 在web.xml里加入spring的加载器

 

代码: 全选

 

<listener>

<listener-class>

org.springframework.web.context.ContextLoaderListener

</listener-class>

</listener>

 

 

其它关于数据源和事务管理,hibernate集成,struts集成等内容还是看官方的文档 比较好

你可能感兴趣的:(spring,Web,bean,Hibernate,struts)