搭建SSH框架Struts2.1、Spring2.5、Hibernate3.3

Web Project这个都会吧!细细

版本

Struts2.1、Spring2.5、Hibernate3.3

1.MyEclipse add Struts2.1 → /* Struts2 Spring Libraries(导入这个包)

2.MyEclipse add Spring导入AOP 、Spring2.5 Presistence Core 、Spring2.5 Presistence JDBC、Spring2.5 Web Libraries

3.MyEclipse add Hibernate3.3 选第二个 Spring onfiguration file(applicationContext.xml) →Existing Spring  onfiguration file →选择数据源→不创建SessionFactory

4.web.xml配置 在Dsign配置,找到Context Parameters →Parameter name填:contextConfigLocation;Parameter value填:classpath:applicationContext.xml(如果applicationContext.xml放在src下面写classpath,如果放在WEB-INF/lib/下就这么写/WEB-INF/lib/applicationContext.xml)

<context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath:applicationContext.xml</param-value>
    </context-param>

<context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/lib/applicationContext.xml</param-value>
    </context-param>

5.Listeners →Browse 写上contextLoader就有提示contextLoaderListener就ok了

 

 <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath:applicationContext.xml</param-value>
    </context-param>
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

之后就部署吧!

SSH  Demo下载地址Mysql数据库http://pan.baidu.com/share/link?shareid=152796&uk=1712110123

因之前搭建ssh总出错!之后总结了一下,本人学生仅供其他学生参考,不喜勿喷!谢谢

转载于:https://www.cnblogs.com/Mr-Wu/archive/2012/10/22/2734017.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值