Therefore: in Maven, the configuration file should read the following two parts of the red word, indispensable.
Not a MAVEN project, you can never write ...
<context-param> <param-name>contextConfigLocation</param-name> <param-value>/we B-inf/classes/dispatcher-servlet.xml</param-value> </context-param><listener> <listener-class>org.springframework.web.context.contextloaderlistener</listener-class > </listener> <servlet> <!--the only servlet in spring is forwarded to control layer--<SERVLET-NAME>DISPATC Her</servlet-name> <servlet-class>org.springframework.web.servlet.dispatcherservlet</ servlet-class> <!--springmvc default configuration name:--> <!--<servlet-name> springmvc<servlet-name> + -servlet--> <!--setting Profile--<init-param> <param-name>contextConfigLocation</param-name> <param-value>/web-i Nf/classes/dispatcher-servlet.xml</param-value> <!--or <param-value>/web-inf/xxx.xml</ Param-value>--> </init-param><load-on-startup>1</load-on-startup> </servlet>
Maven Could not open ServletContext resource [/web-inf/applicationcontext.xml]