快捷导航

spring boot 无法访问静态html

@RequestMapping("/ts")@Controllerpublic class TestStaticController {    @GetMapping("/idx")    public String idx() {        return "index";    }}上面controller的代码,index页面放在了resources的templates下
   org.springframework.boot   spring-boot-starter-thymeleaf也已经添加了 thymeleaf 的依赖,仍然不能访问(404),求解

免责声明:本内容仅代表回答者见解不代表本站观点,请谨慎对待。

版权声明:作者保留权利,不代表本站立场。

回复

使用道具 举报

参与会员1

404是找不到页面。。。一定是你的配置出问题了不是thymeleaf的问题。这种情况你就算单纯的写HTML也会报404的。


localhost:端口号/ts/ids
回复

使用道具 举报

可能感兴趣的问答

发新帖
  • 微信访问
  • 手机APP