我在启动应用程序时收到此错误:
java.io.FileNotFoundException:无法打开ServletContext资源[/WEB-INF/spring/servlet/servlet-context.xml]
我不知道Spring为什么要搜索servlet-context.xml . 我的所有上下文都在web-inf / context / portlet中配置是否有我可以添加到web.xml的设置,因此tomcat可以将来自不同目录的上下文解析为/WEB-INF/spring/servlet/servlet-context.xml ?或者是解决此问题的另一种方法?
1 回答
通常在WEB-INF / web.xml文件中设置上下文的位置,请参见此处:http://static.springsource.org/spring/docs/3.1.x/spring-framework-reference/htmlsingle/spring-framework-reference.html#web-integration-common
因此,您的WEB-INF / web.xml文件应该类似,请仔细检查 contextConfigLocation 值是否指向您的上下文配置文件: