无法打开ServletContext资源[/WEB-INF/applicationContext.xml]
- 论坛
- 无法打开ServletContext资源[/WEB-INF/applicationContext.xml]
11 浏览
无法打开ServletContext资源[/WEB-INF/applicationContext.xml]
好的,我是第500个提出这个问题的用户,我读了很多答案但仍然没有运气。
父模块pom包含:
org.springframework spring-web ${spring.framework.version} org.springframework spring-webmvc ${spring.framework.version}
子模块有maven-jetty-plugin
,我用jetty:run
运行我的webapp模块。
web.xml
定义了标准的dispatcher模块:
org.springframework.web.context.ContextLoaderListener dispatcher org.springframework.web.servlet.DispatcherServlet 1 dispatcher /
我在WEB-INF
下有一个dispatcher-servlet.xml
文件,但启动失败,显示:
FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
问题出在哪里?文档和所有人都说Spring MVC会搜索XX-servlet.xml,其中XX是servlet的名称。为什么它要搜索applicationContext.xml
?