Could not open ServletContext resource [/WEB-INF/applicationContext.xml] solution

Spring official document stipulates that if no location is specified in the configuration file contextConfigLoction context, to the WEB-INF to look for the corresponding profile will be the default.
The default path is theoretically classpath WEB-INF / classes
so the solution is to redefine it again in the context-param in.
Add the following code web.xml (preferably on opposing front position)

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param>

Guess you like

Origin www.cnblogs.com/xianz666/p/12112548.html