struts2.18与spring整合怎么老是出unable load .....的异常啊,我都调了好几天了,还是这个问题,这是怎么会事啊,请各位高手指点一下,在此,先谢谢了
解决方案 »
- 关于spring中配置quartz报错的问题
- hibernate多条件(条件个数不定)查询怎么写?
- org.hibernate.exception.ConstraintViolationException: could not insert: [com.crownsoft.qsm.Teacher],这是什么错误?
- spring一个问题非常感谢
- 关于structs-config.xml的一个奇怪问题
- jsp中用out.println();来动态输出xml文件,为什么有时能显示,有时什么都没有呢?
- 如何把Date型的数据转换为C++兼容的int型数据?在线!
- 马加爵生活琐事合集看完让人哭了!!教育不能商业化啊!!(大家多传阅)
- 我现在得到两个Collection,想对它们做并集和交集操作,怎么解决呢?
- 帮忙编程
- 问几个简单的数学问题?
- 请教大家在实际项目开发中,主键都是用什么策略?
load class?load xml?
检查你的jar是否都引入叻?xml配置都对吗?
网上很多例子的,对照着一步步来嘛。
在web.xml文件中配置spring的监听器
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
再确保配置了struts2的过滤器
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
struts2-spring-plugin.jar
spring.jar
commons-logging.jar2>.属性配置:
struts.objectFactory = spring
struts.objectFactory.spring.autowire = name3>.web.xml配置:
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>4>.applicationContext.xml配置:
<beans default-autowire="byName"></beans>5>.struts.xml配置:
<action name="请求" class="Spring配置文件中定义id名字"></action>注:jar包版本号没有加,根据struts2版本决定。