Commit 2d1f758f authored by Dave Syer's avatar Dave Syer

Autoconfigure MVC if HandlerMapping already defined

parent e695b4a6
...@@ -44,7 +44,6 @@ import org.springframework.web.accept.ContentNegotiationManager; ...@@ -44,7 +44,6 @@ import org.springframework.web.accept.ContentNegotiationManager;
import org.springframework.web.filter.HiddenHttpMethodFilter; import org.springframework.web.filter.HiddenHttpMethodFilter;
import org.springframework.web.servlet.DispatcherServlet; import org.springframework.web.servlet.DispatcherServlet;
import org.springframework.web.servlet.HandlerAdapter; import org.springframework.web.servlet.HandlerAdapter;
import org.springframework.web.servlet.HandlerMapping;
import org.springframework.web.servlet.View; import org.springframework.web.servlet.View;
import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer; import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer;
import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.EnableWebMvc;
...@@ -64,7 +63,7 @@ import org.springframework.web.servlet.view.ContentNegotiatingViewResolver; ...@@ -64,7 +63,7 @@ import org.springframework.web.servlet.view.ContentNegotiatingViewResolver;
@Configuration @Configuration
@ConditionalOnClass({ Servlet.class, DispatcherServlet.class, @ConditionalOnClass({ Servlet.class, DispatcherServlet.class,
WebMvcConfigurerAdapter.class }) WebMvcConfigurerAdapter.class })
@ConditionalOnMissingBean({ HandlerAdapter.class, HandlerMapping.class }) @ConditionalOnMissingBean({ HandlerAdapter.class })
@Order(Ordered.HIGHEST_PRECEDENCE + 10) @Order(Ordered.HIGHEST_PRECEDENCE + 10)
@AutoConfigureAfter(EmbeddedServletContainerAutoConfiguration.class) @AutoConfigureAfter(EmbeddedServletContainerAutoConfiguration.class)
public class WebMvcAutoConfiguration { public class WebMvcAutoConfiguration {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment