mxab / thymeleaf-extras-data-attribute

Thymeleaf dialect for data attributes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

thymeleaf-extras-data-attribute

Thymeleaf dialect for data attributes

Setup

Maven

<dependency>
    <groupId>com.github.mxab.thymeleaf.extras</groupId>
    <artifactId>thymeleaf-extras-data-attribute</artifactId>
    <version>2.0.1</version>
</dependency>

Code

templateEngine.addDialect(new DataAttributeDialect());

Usage

Source

<html>
<body data:foo="${'bar'}" data:msg="#{my.message}" >
</body>
</html>

Result

<html>
<body data-foo="bar" data-msg="Your resolved message" >
</body>
</html>

Credits

Big shout-out to @dtrunk90 who rewrote everything for Thymeleaf 3.0

About

Thymeleaf dialect for data attributes

License:Apache License 2.0


Languages

Language:Java 100.0%