First, to be clear, SPRINGMVC is actually a component of spring.
For example, we know that spring has similar components like, AOP TX and so on, so SPRINGMVC is actually a component of spring and is part of the spring framework, so don't think of SPRINGMVC as another frame!
So in the configuration, or in accordance with the configuration of spring, the configuration monitoring, configuration monitoring, the configuration profile, configuration profile, as usual
Two, spring configuration in Web. xml
Configuring Spring in Web. XML can be roughly divided into two points
1, configure spring's monitoring, contextloaderlistener
2. Configure the Spring configuration file location contextlocation
<context-param>
<param-name>contextlocation</param-name>
<param-Value>classpath:applicationContext.xml</param-Value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
This completes the configuration of spring's information in Web. xml
Third, SPRINGMVC configuration in Web. xml
The same configuration Springmvc also requires two points
Configuration file path for 1,SPRINGMVC
2,dispatcherservlet
<servlet>
<servlet-name>SpringMVC</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextLocation</param-name>
<param-value>classpath:applicationSpringMVC.xml</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>SpringMVC</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
Spring+springmvc+mybatis Integrated Learning note "one"