Add ServletRegistrationBean for DispatcherServlet
Mapping is exposed via server.servletPath. Fixes gh-379
This commit is contained in:
@@ -30,6 +30,7 @@ import org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfigurati
|
||||
import org.springframework.boot.autoconfigure.web.DispatcherServletAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.web.HttpMessageConvertersAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.web.ServerPropertiesAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
@@ -43,7 +44,6 @@ import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import sample.tomcat.service.HelloWorldService;
|
||||
import sample.tomcat.web.SampleController;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
/**
|
||||
@@ -57,7 +57,8 @@ public class NonAutoConfigurationSampleTomcatApplicationTests {
|
||||
|
||||
@Configuration
|
||||
@Import({ EmbeddedServletContainerAutoConfiguration.class,
|
||||
DispatcherServletAutoConfiguration.class, WebMvcAutoConfiguration.class,
|
||||
DispatcherServletAutoConfiguration.class,
|
||||
ServerPropertiesAutoConfiguration.class, WebMvcAutoConfiguration.class,
|
||||
HttpMessageConvertersAutoConfiguration.class,
|
||||
PropertyPlaceholderAutoConfiguration.class })
|
||||
@ComponentScan(basePackageClasses = { SampleController.class, HelloWorldService.class })
|
||||
|
||||
Reference in New Issue
Block a user