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配置文件;同时严格区分大小写。

posted @ 2017-02-06 12:29  magina_敌法  阅读(6456)  评论(1编辑  收藏  举报