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

来源:互联网 发布:淘宝上二手苹果6可信吗 编辑:程序博客网 时间:2024/06/05 18:19

初次部署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了

原创粉丝点击