zoukankan      html  css  js  c++  java
  • spring boot -- 无法读取html文件,碰到的坑

    碰到的坑,无法Controller读取html文件

    1. Controller类一定要使用@Controller注解,不要用@RestController

    2. resource目录下创建templates文件加,里面创建html文件

    3.一开始创建项目的时候,就添加spring-boot-starter-thymeleaf

    如果一开始创建项目的时候,没有选择,可以试试下面的操作(网上有人说可以,反正我是没成功)

    右键点击pom.xml文件,选择Maven -> Generate Sources and Update Folders

  • 相关阅读:
    用VS Code写C++程序如何运行
    DRF
    DRF
    DRF
    DRF
    DRF
    DRF
    DRF
    DRF
    DRF
  • 原文地址:https://www.cnblogs.com/zhzhlong/p/10164964.html
Copyright © 2011-2022 走看看