<bean class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping"/> <bean class="org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter"/>
第二种:
<!-- 注解方式映射,3.1之前使用 DefaultAnnotationHandlerMapping --> <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" /> <bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"> <!-- 注册拦截器 --> <property name="interceptors"> <list> <ref bean="adminContextInterceptor"/> <ref bean="adminLocaleIntercept"/> <ref bean="fireWallInterceptor"/> </list> </property> </bean>
第三种:
<!-- 注解方式映射,3.1之后使用 RequestMappingHandlerMapping --> <bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping" /> <bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter"> <!-- 线程安全的访问session --> <property name="synchronizeOnSession" value="true" /> </bean>