3,Spring MVCConfiguration
A)Web. xmlFile
<! -- Spring MVC --> <servlet-Name> DMT </servlet-Name> <servlet-class> Org. springframework. web. servlet. dispatcherservlet </servlet-class> <init-param> <param-Name> contextconfiglocation </param-Name> <param-value>/WEB-INF/*-servlet. XML </param-value> </init-param> <load-on-startup> 0 </load-on-startup> </servlet> <servlet-mapping> <Servlet -Name> DMT </servlet-Name> <URL-pattern> *. DO </url-pattern> <! -- Match the redirection suffix --> </servlet-mapping> B) Dmt-serverlet.xml file <context: component-scan base-package = "com. HB "use-default-filters =" false "> <context: Include-filter expression =" org. springframework. stereotype. controller "type =" annotation "/> </Context: component-scan> <Bean class =" org. springframework. web. servlet. MVC. annotation. defaultannotationhandlermapping "/> <Bean class =" org. springframework. web. servlet. MVC. an Notation. annotationmethodhandleradapter "lazy-init =" false "/> <bean id =" viewresolver "class =" org. springframework. web. servlet. view. internalresourceviewresolver "> <property name =" viewclass "value =" org. springframework. web. servlet. view. jstlview "/> <property name =" prefix "value ="/WEB-INF/JSP/"/> <property name =" suffix "value = ". JSP "/> </bean> <! -- URL Mapping and parametermethod in XML mode must be configured with simplecontrollerhandleradapter after being integrated into annotation MVC --> <bean id = "urlmapping" class = "org. springframework. web. servlet. handler. beannameurlhandlermapping "> <property name =" order "value =" 1 "> </property> </bean> <Bean class =" org. springframework. web. servlet. MVC. simplecontrollerhandleradapter "/> <bean id =" methodnameresolver "class =" org. springframework. web. servlet. MVC. multiaction. parametermethodnameresolver "> <property name =" paramname "value =" method "/> <property name =" defaultmethodname "value =" Index "/> </bean>