thymeleaf textarea 赋值

教程分享 > Java教程 > Thymeleaf (10780) 2024-08-06 15:10:41

本文说一下在thymeleaf模板引擎中,如何给 textarea 赋值。
普通的input赋值我们是这样的

<input type="text" class="form-control" placeholder="搜索标题" name="searchTitle" th:value="${site.searchTitle}">

但是textarea标签的赋值方式并非上面这样,而是以下面的方式赋值:

<textarea name="searchDescription" type="text"  style="width: 100%;resize: none;" rows="3" class="form-control" placeholder="搜索描述" th:text="${site.searchDescription}"></textarea>


好了搞定!!!

https://www.leftso.com/article/716.html

相关文章
本文说一下在thymeleaf模板引擎中,如何给 textarea 赋值
SSH/SSM项目中如何集成thymeleaf?本文将讲解SSH/SSM项目中如何集成thymeleaf模板引擎
Thymeleaf 递归,Thymeleaf模板引擎递归展示如评论留言等场合适用
使用thymeleaf 模板创建时间 使用thymeleaf 创建指定日期为:2023-10-18 #dates.create(2023,10,18) 使用thymeleaf ...
thymeleaf 设置不校验html标签
thymeleaf模板 报错信息:​​​​​​​org.thymeleaf.exceptions.TemplateInputException: Error resolving template...
环境Thymeleaf 3.0循环5次需求:输出5个li编码参考:&lt;ul&gtl; &lt;li th:each="index:${#numbers.sequence(1,
springboot 使用thymeleaf 模板引擎中url中的&引起的org.xml.sax.SAXParseException: 对实体 "uid" 的引用必须以 ';' 分隔符结尾。问题解决
设置数据源将数据写入到 Model 中 @RequestMapping("/menulist") public String MenuManagerList(M
配置在resources目录下面创建i18n目录,然后创建几个文件messages.properties 默认显示语言内容messages_en_US.prop