java - Circular view path Spring boot tutorial -
i'm learning spring boot. follow guides , i'm tryng 1 : securing web application.
so i've made 2 files (hello.html/home.html) , deploy application see them when try access localhost:8080 error :
circular view path [home]: dispatch current handler url [/home] again. check viewresolver setup! (hint: may result of unspecified view, due default view name generation.)
if can me there ? here code :
src/main/java/com/society/myapplication :
import org.springframework.boot.springapplication; import org.springframework.boot.autoconfigure.springbootapplication; @springbootapplication public class myapplication { public static void main(string[] args) throws throwable { springapplication.run(calamarapplication.class, args); } }
src/main/java/com/society/mvcconfig.java
import org.springframework.context.annotation.configuration; import org.springframework.web.servlet.config.annotation.viewcontrollerregistry; import org.springframework.web.servlet.config.annotation.webmvcconfigureradapter; @configuration public class mvcconfig extends webmvcconfigureradapter { @override public void addviewcontrollers(viewcontrollerregistry registry) { registry.addviewcontroller("/home").setviewname("home"); registry.addviewcontroller("/").setviewname("home"); registry.addviewcontroller("/hello").setviewname("hello"); registry.addviewcontroller("/login").setviewname("login"); } }
src/main/resources/templates/home.html
<!doctype html> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3"> <head> <title>hello world!</title> </head> <body> <h1>hello world!</h1> </body> </html>
thanks advance.
Comments
Post a Comment