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