出现问题提示Could not open ServletContext resource [/WEB-INF/spring-security.xml]
Upon initialization of a DispatcherServlet, Spring MVC looks for a file named [servlet-name]-servlet.xml in the WEB-INF directory
of your web application and creates the beans defined there, overriding the definitions of any beans defined with the same name in the global scope.
Consider the following DispatcherServlet Servlet configuration (in the web.xml file):
<web-app> <servlet> <servlet-name>golfing</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>golfing</servlet-name> <url-pattern>/golfing/*</url-pattern> </servlet-mapping> </web-app>
With the above Servlet configuration in place, you will need to have a file called /WEB-INF/golfing-servlet.xml in
your application; this file will contain all of your Spring Web MVC-specific components (beans).
本文探讨了Spring MVC初始化DispatcherServlet时查找特定配置文件的问题,并提供了正确的配置方法。
3158

被折叠的 条评论
为什么被折叠?



