I am trying out the Spring IO Guide for "Securing a Web Application" available at https://spring.io/guides/gs/securing-web/.
The guide instructs to build a simple unsecured web application first and secure it using Spring Security later. However, after building the unsecured web application with Spring Boot 2.0.1.RELEASE version, I am getting the following error on trying to access a URL (http://localhost:9191/hello) of the web application:
2018-05-04 09:58:07.742 ERROR 25968 --- [nio-9191-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Circular view path [hello]: would dispatch back to the current handler URL [/hello] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.)] with root cause
javax.servlet.ServletException: Circular view path [hello]: would dispatch back to the current handler URL [/hello] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.)
I replicated the code as available at the above URL (i.e. https://spring.io/guides/gs/securing-web/) and my embedded tomcat server is running on port 9191 (as port 8080 is used by some other app). Any help is appreciated. Thanks in advance!
Edit:
Following is the configuration/controller code from the guide:
@Configuration
public class MvcConfig implements WebMvcConfigurer {
public void addViewControllers(ViewControllerRegistry registry) {
registry.addViewController("/home").setViewName("home");
registry.addViewController("/").setViewName("home");
registry.addViewController("/hello").setViewName("hello");
registry.addViewController("/login").setViewName("login");
}
}