MvcConfig.java 840 B

1234567891011121314151617181920212223
  1. package com.yihu.jw.config;
  2. import com.yihu.jw.version.JWRequestMappingHandlerMapping;
  3. import org.springframework.context.annotation.Bean;
  4. import org.springframework.context.annotation.Configuration;
  5. import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
  6. import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
  7. /**
  8. * Created by chenweida on 2017/6/15.
  9. */
  10. @Configuration
  11. public class MvcConfig extends WebMvcConfigurationSupport {
  12. @Override
  13. @Bean
  14. public RequestMappingHandlerMapping requestMappingHandlerMapping() {
  15. RequestMappingHandlerMapping handlerMapping = new JWRequestMappingHandlerMapping();
  16. handlerMapping.setOrder(0);//顺序是第一
  17. handlerMapping.setInterceptors(getInterceptors());
  18. return handlerMapping;
  19. }
  20. }