自己在做一个spring MVC的项目时,遇到这样的报错
Servlet.init() for servlet [dispatcherServlet] threw exception
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/dispatcherServlet-servlet.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/dispatcherServlet-servlet.xml]
java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/dispatcherServlet-servlet.xml]
是在web.xml文件中配置的构造器除了问题。报错提示无法打开这个资源。
原因在web.xml文件中写构造器时,配置文件param-name标签写错了。
经过测试,配置文件中的name不能自己瞎写,都是固定的名称
自己是通过对比之前写成功的配置文件,进行修改的。


![java.io.FileNotFoundException:无法打开 ServletContext 资源 [/WEB-INF/dispatcherServlet-servlet.xml] java.io.FileNotFoundException:无法打开 ServletContext 资源 [/WEB-INF/dispatcherServlet-servlet.xml]](http://www.mshxw.com/aiimages/31/937209.png)
