Spring

오류기록( spring boot)javax.servlet.ServletException: Circular view path [project]: would dispatch back to the current handler URL

aesup 2021. 6. 3. 16:11
728x90
javax.servlet.ServletException: Circular view path [project]: would dispatch back to the current handler URL [/project] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.)
 
원인중 하나.
 
@RequestMapping 애노테이션의 URL 패턴과
String 리턴 값이 같을경우




 @RequestMapping("/project")    // URL 패턴
 public String project(){
    return "project";                           // String 리턴값
 }


메소드 이름은 같아도 상관없는 듯 하고요,


해결 방법은 URL패턴과 String 리턴값을 다르게 해주면 된다


 @RequestMapping("/project")
 public String project(){
    return "project1";
 }
728x90