错误:
Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Circular view path [build]: would dispatch back to the current handler URL [/build] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.)]
原因:
Controller层设置的注解有问题:
@RestController使用成了@Controller
文章讨论了在SpringMVC应用中,由于Controller层使用了错误的注解(将@RestController误用为了@Controller),导致Servlet服务抛出Circularviewpath异常。解决方案是检查并正确配置ViewResolver以避免循环引用。
2万+





