1. 程式人生 > >SpringMVC Caused by: java.io.FileNotFoundException

SpringMVC Caused by: java.io.FileNotFoundException

Caused by: java.io.FileNotFoundException: Could not open ServletContext resource[/WEB-INF/spring-config.xml] atorg.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:158)atorg.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(

XmlBeanDefinitionReader.java:330)

... 28 more

嚴重: Servlet [springmvc] in web application

[/SpringMvcDemo] threw load() exception

出現問題的元原因:

  1. contextConfigLocation的值與springmvc的配置檔名稱不相同
  2. Handler的對映不正確,正確寫法:<bean name=/name class=**/>,不能寫成<bean name=name class=**/>