Why can't I intercept root requests using springMVC? Always use the default index.html

spring intercepts localhost:8080/1 to intercept my chat page, but not to the root directory. Go back to the default index page;

there are several lines of log output in the console log

2018-06-04 15:46:03.601  INFO 15836 --- [  restartedMain] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/login] onto handler of type [class org.springframework.web.servlet.mvc.ParameterizableViewController]
2018-06-04 15:46:03.601  INFO 15836 --- [  restartedMain] o.s.w.s.handler.SimpleUrlHandlerMapping  : Root mapping to handler of type [class org.springframework.web.servlet.mvc.ParameterizableViewController]
2018-06-04 15:46:03.601  INFO 15836 --- [  restartedMain] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/1] onto handler of type [class org.springframework.web.servlet.mvc.ParameterizableViewController]
2018-06-04 15:46:03.663  INFO 15836 --- [  restartedMain] o.s.b.a.w.s.WelcomePageHandlerMapping    : Adding welcome page template: index

configuration of springMVC

@Configuration
public class WebMvcConfg implements WebMvcConfigurer {
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        registry.addViewController("/login").setViewName("/login");
        registry.addViewController("/").setViewName("/chat");
        registry.addViewController("/1").setViewName("/chat");
    }
}

configuration of spring security

@Configuration
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {

    @Override
    protected void configure(HttpSecurity http) throws Exception {

        http.authorizeRequests()
                .anyRequest()
                .authenticated()
                .and()
                //
                .formLogin()
                //
                .loginPage("/login")
                //
                .defaultSuccessUrl("/")
                .permitAll()
                .and()
                //
                .logout()
                .permitAll();
    }
   }

index.html is the default configuration of springboot after using thymeleaf


because the thymeleaf is configured to visit the index.html page under the static folder by default,
therefore, when intercepting, you need to configure to intercept index.html
registry.addViewController ("/ index.html"). SetViewName ("login");
in this way, index.html, will be blocked to enter the login.html page when accessing the root directory

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1be8b09-31160.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1be8b09-31160.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?