当前位置:   article > 正文

访问页面资源,controller层无法识别,资源无法访问_请求的资源为controller层,不可用

请求的资源为controller层,不可用

报错显示:

idea Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as a fallback.  Mon Apr 15 15:11:23 IRKT 2024 There was an unexpected error (type=Internal Server Error, status=500). Circular view path [login]: would dispatch back to the current handler URL [/login] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.) javax.servlet.ServletException: Circular view path [login]: would dispatch back to the current handler URL [/login] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.)其他部分省略。。。。。。

描述:

controller已放在正确的位置,静态页面资源放在正确的位置,但是还是无法访问页面资源,与舍友模版一致,但是无法访问。

解决:

查看了多个csdn上的解答,最后试了一种方法:

“在启动类中配置@SpringBootApplication(scanBasePackages="controller"),注明你的controller层的位置”

但是在吃过晚餐后,删掉(scanBasePackages="controller"),又可以访问到资源了,不明白是如何解决的,或许是idea需要重启一下,才能访问到资源

来源:

Whitelabel Error PageThis application has no explicit mapping for /error, so you are seeing this as-CSDN博客

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/木道寻08/article/detail/946653
推荐阅读
相关标签
  

闽ICP备14008679号