我是靠谱客的博主 糟糕斑马,最近开发中收集的这篇文章主要介绍thymeleaf 常量_Thymeleaf常用语法:表达式语法之运算符,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

Thymeleaf表达式语法之常量分为字符串常量、数字常量、布尔值常量、空值常量;

运算符分为算术运算符、关系运算符、条件运算符、无操作符。

开发环境:IntelliJ IDEA 2019.2.2

Spring Boot版本:2.1.8

新建一个名称为demo的Spring Boot项目。

1、pom.xml

加入Thymeleaf依赖

org.springframework.boot

spring-boot-starter-thymeleaf

2、src/main/java/com/example/demo/TestController.java

packagecom.example.demo;importorg.springframework.stereotype.Controller;importorg.springframework.ui.Model;importorg.springframework.web.bind.annotation.RequestMapping;

@Controllerpublic classTestController {

@RequestMapping("/")publicString test(Model model){

model.addAttribute("flag", true);return "test";

}

}

3、src/main/resources/templates/test.html

一、表达式常量

1、字符串常量:使用单引号,或|

最后

以上就是糟糕斑马为你收集整理的thymeleaf 常量_Thymeleaf常用语法:表达式语法之运算符的全部内容,希望文章能够帮你解决thymeleaf 常量_Thymeleaf常用语法:表达式语法之运算符所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(25)

评论列表共有 0 条评论

立即
投稿
返回
顶部