1. Front-section Controller
New project configuring the front-segment controller in Web. xml
<servlet>
<servlet-name>springmvc</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>
Classpath:spring-servlet.xml
</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>springmvc</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<!--
Contextconfiglocation Configuring SPRINGMVC Load profiles (configuring processor mapper, adapters, etc.)
Note: If the processor mapper is not configured in Spring-servlet.xml, the processor adapter is loaded by default
Org.springframework.web.servlet.DispatcherServlet.properties as shown
If you do not configure Contextconfiglocation, the/web-inf/servlet name-servlet.xml (springmvc-servlet.xml) is loaded by default.
-
2. Non-annotated processor mapper
Where the processor mapper includes the default configuration non-annotated form includes the following two
Org.springframework.web.servlet.handler. beannameurlhandlermapping
Org.springframework.web.servlet.handler. simpleurlhandlermapping
3, non-annotated processor adapter
Where the non-callout processor adapter includes
Org.springframework.web.servlet.mvc. Simplecontrollerhandleradapter
Org.springframework.web.servlet.mvc. Httprequesthandleradapter////By modifying response corresponding JSON format data
4. View Parser
<bean id= "Viewresolver"
class= "Org.springframework.web.servlet.view.InternalResourceViewResolver" >
<property name= "prefix" value= "/web-inf/jsp/"/>
<property name= "suffix" value= ". jsp"/>
</bean>
5. Annotation form-processor Mapper and processor adapter
The default annotation processor mapper is
Org.springframework.web.servlet.mvc.annotation. defaultannotationhandlermapping
The default loading of the old version for 2.5 is recommended with 3.2 configuration with
Org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping
The default processor adapter is
Org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter
The default loading of the old version for 2.5 is recommended with 3.2 configuration with
Recommended for
Org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter
The Spring-servlet.xml is configured to
<!--processor Mapper--
<bean class= "org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping"/>
<!--Processor Adapter--
<bean class= "Org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter"/>
Note that these two sentences can be replaced by the sentence below.
<!--note-driven
<mvc:annotation-driven></mvc:annotation-driven>
Note *.do in the Controller scan package
<context:component-scan base-package= "Com.test.controller" ></context:component-scan>
SPRINGMVC Front-Segment Controller Processor Mapper Processor Adapter View View Resolver configuration