zoukankan      html  css  js  c++  java
  • 关于初次使用Thymeleaf遇到的问题 2020-08-11

    关于初次使用Thymeleaf遇到的问题

    环境:

    IDEA :2020.1

    Maven:3.5.6

    SpringBoot: 2.3.2

    原做法:

    按照视频教程,导入依赖,并修改报的版本为3.0.9,适配包的布局功能修改为2.2.2

    		<dependency>
    			<groupId>org.springframework.boot</groupId>
    			<artifactId>spring-boot-starter-thymeleaf</artifactId>
    		</dependency>
    切换thymeleaf版本
    <properties>
    		<thymeleaf.version>3.0.9.RELEASE</thymeleaf.version>
    		<!-- 布局功能的支持程序  thymeleaf3主程序  layout2以上版本 -->
    		<!-- thymeleaf2   layout1-->
    		<thymeleaf-layout-dialect.version>2.2.2</thymeleaf-layout-dialect.version>
      </properties>
    

    报错:

    org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration$ThymeleafDefaultConfiguration.templateEngine(ThymeleafAutoConfiguration.java:142)  The following method did not exist:
    

    修正方法:

     <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-thymeleaf</artifactId>
            </dependency>
    

    直接引入依赖,不需要修改,让SpringBoot 帮助我们自动适配版本号即可。


    还有一个未知问题,在视频教程笔记(.pdf)复制下来的文本导入依赖时无法识别文本中的 ‘ - ’ 。

    <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring‐boot‐starter‐thymeleaf</artifactId>
    2.1.6
    </dependency>
    

    重新输入 ‘ - ’ 即可导入依赖。

    初步怀疑是编码问题

    2020-08-11

  • 相关阅读:
    [03] html 中引入与使用css
    [04] 前端构建工具区别
    [04]测试框架杂谈
    [03] react 测试
    [02] 前端测试工具集锦
    [01]关于TDD、BDD和DDD的一些看法
    [04]JS获取文件大小方法
    [03]使用阿里RAP搭建前端Mock Server
    [1]区分event对象中的[clientX,offsetX,screenX,pageX]
    [02]a tag只为成button用时候设置href的办法
  • 原文地址:https://www.cnblogs.com/l1ng14/p/13477062.html
Copyright © 2011-2022 走看看