Little cainiao learns spring boot and little cainiao springboot
New to cainiao, great gods do not spray, a little bit of excitement, just don't worry. Because I always pretend to be humorous because I want to make myself happy.
- Spring mvc provided by spring boot does not meet your needs. You can write a control class and add the @ EnableWebMvc annotation to control the mvc configuration on your own.
- Spring mvc provided by spring boot needs to be retained and configured by itself, you can customize a WebMvcConfigureAdapter without using the EnableWebMvc annotation;
1 @ Configuration2 public class WebConfig extends WebMvcConfigurerAdapter {3 @ Override4 public void addViewControllers (ViewControllerRegistry registry) {5 registry. addViewController ("/xx "). setViewName ("/xx"); 6} 7}
The addViewControllers method here does not overwrite the addViewControllers method in WebMvcAutoConfiguration; that is, we can use it at the same time.