您的位置:首页 > 其它

工程页面报404,服务启动时报过滤器配置有问题

2011-03-17 11:03 369 查看
初次部署ssh项目,出现了好多的问题,弄得我很无奈啊。。。

昨天启动tomcat的时候,又报出异常啦

********** FATAL ERROR STARTING UP STRUTS-SPRING INTEGRATION **********
Looks like the Spring listener was not configured for your web app!
Nothing will work until WebApplicationContextUtils returns a valid ApplicationContext.
You might need to add the following to web.xml:
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

其实这个时候我的web.xml 还没有整合spring呢,只是建立一个简单的struts2工程,验证一下struts2是否可以,怎么报这个错啊,于是查找原因,结果发现,我的sturts.xml文件路径没有放到默认位置,放到了web-inf 下面的config文件里面,为的是方便查看。但是我在web.xml中没有配置。修改以后的web.xml代码为:



然后在struts.xml中在增加此信息:

<include file="struts-default.xml"/>

所有文件保存,发布。重启服务,都没有问题,而且页面也不报404了
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: