如果您的程序报 No mapping for GET,没有找到对应的映射,这个是由于你程序结合了thymeleaf
使用thymeleaf的时候,要经过controller 跳转到页面上,不要直接就跳转对于的页面
比如 下面:
@Controller
public class RouterController {
@RequestMapping("/index")
public String index(){
return "shop-index";
}
}
本文介绍了一个常见的Thymeleaf页面映射错误NomappingforGET的解决方案,强调了在使用Thymeleaf时,应当通过Controller来正确跳转页面,而不是直接进行页面跳转。
719

被折叠的 条评论
为什么被折叠?



