访问页面资源,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博客

  • 8
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值