当前位置: 代码迷 >> Java Web开发 >> 关于搭建SSH中添加Spring时出现的有关问题
  详细解决方案

关于搭建SSH中添加Spring时出现的有关问题

热度:2580   发布时间:2013-02-25 21:18:30.0
关于搭建SSH中添加Spring时出现的问题
先搭建struts2.1,测试通过,接着搭建Spring3.0,步骤如下:
1) addSpring --> 选择core lib 和 web lib --> Jar Library Installation选择Copy*** --> finish;
2) 在web.xml中,添加:
 <context-param>
  <param-name>contextConfigLocation</param-name>
  <param-value>/WEB/-INF/classes/application*.xml</param-value>
  </context-param>
  <listener>
  <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  </listener>

3) 在applicationContext.xml中添加bean的定义:
<bean id="hwpLoginAction" class="com.action.LoginAction"></bean>

4) 在struts.xml中修改:
<action name="Login" class="hwpLoginAction">

5)在 java build path 中添加 new library --> myeclipse libraries --> struts2 spring libraries;

重启tomcat,
出现:

Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener

的错误提示,


求解!!

------解决方案--------------------------------------------------------
http://blog.csdn.net/leiffort/article/details/4512812
------解决方案--------------------------------------------------------
探讨

根据2楼童鞋给的信息,解决了以上的问题,但是有出现了新的问题,
Unable to load configuration. - bean
继续求助!
  相关解决方案