springmvc报java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/xxxx.xml]


如报错信息为:java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/springmvcFileload-servlet.xml]

首先,springmvc工程的web.xml中如有:www.twitterchina.net

<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

则springmvc会去找applicationContext.xml配置文件,除非你用servlet另行指定。

其次,web.xml文件工程的servlet名称如果和项目名不同,而且也未指定springmvc的配置文件,程序会根据servet名称在WEB-INF下寻找对应的xml配置文件;同时严格区分大小写。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM