Use maven to create a web project and set the Spring configuration file applicationContext. xml is placed under src/resource, and class path resource [applicationContext is prompted during eclipse compilation. xml] cannot be opened because it does not exist error. However, the command mvn clean package is successfully compiled. The web. xml configuration is as follows:
<Context-param>
<Param-name> contextConfigLocation </param-name>
<Param-value> classpath: applicationContext. xml </param-value>
</Context-param>
Search by google (google could not be used before, and Baidu searched for egg pain). It was found that the classpath was not directed to the resource path, and the file was not found. You need to add a * after classpath to solve the problem.
<Context-param>
<Param-name> contextConfigLocation </param-name>
<Param-value> classpath *: applicationContext. xml </param-value>
</Context-param>