Thymeleaf JAWR Extension

Sonatype helps open source projects to set up Maven repositories on https://oss.sonatype.org/

License

License

Categories

Categories

Leaf Data Databases
GroupId

GroupId

com.github.dtrunk90
ArtifactId

ArtifactId

thymeleaf-jawr-extension
Last Version

Last Version

2.0.3
Release Date

Release Date

Type

Type

jar
Description

Description

Thymeleaf JAWR Extension
Sonatype helps open source projects to set up Maven repositories on https://oss.sonatype.org/
Project URL

Project URL

https://github.com/dtrunk90/thymeleaf-jawr-extension
Source Code Management

Source Code Management

http://github.com/dtrunk90/thymeleaf-jawr-extension

Download thymeleaf-jawr-extension

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.dtrunk90/thymeleaf-jawr-extension/ -->
<dependency>
    <groupId>com.github.dtrunk90</groupId>
    <artifactId>thymeleaf-jawr-extension</artifactId>
    <version>2.0.3</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.dtrunk90/thymeleaf-jawr-extension/
implementation 'com.github.dtrunk90:thymeleaf-jawr-extension:2.0.3'
// https://jarcasting.com/artifacts/com.github.dtrunk90/thymeleaf-jawr-extension/
implementation ("com.github.dtrunk90:thymeleaf-jawr-extension:2.0.3")
'com.github.dtrunk90:thymeleaf-jawr-extension:jar:2.0.3'
<dependency org="com.github.dtrunk90" name="thymeleaf-jawr-extension" rev="2.0.3">
  <artifact name="thymeleaf-jawr-extension" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.dtrunk90', module='thymeleaf-jawr-extension', version='2.0.3')
)
libraryDependencies += "com.github.dtrunk90" % "thymeleaf-jawr-extension" % "2.0.3"
[com.github.dtrunk90/thymeleaf-jawr-extension "2.0.3"]

Dependencies

provided (6)

Group / Artifact Type Version
javax.servlet : javax.servlet-api jar 3.1.0
javax.servlet.jsp : jsp-api jar 2.2
net.jawr : jawr-core jar 3.9
org.springframework : spring-webmvc jar 5.0.5.RELEASE
org.springframework.boot : spring-boot-autoconfigure jar 2.0.1.RELEASE
org.thymeleaf : thymeleaf jar 3.0.9.RELEASE

test (5)

Group / Artifact Type Version
junit : junit jar 4.12
net.jawr.extensions : jawr-spring-extension jar 3.9
org.springframework : spring-test jar 5.0.5.RELEASE
org.thymeleaf : thymeleaf-spring5 jar 3.0.9.RELEASE
org.thymeleaf : thymeleaf-testing jar 3.0.3.RELEASE

Project Modules

There are no modules declared in this project.

Thymeleaf Jawr Extension

<dependency>
	<groupId>com.github.dtrunk90</groupId>
	<artifactId>thymeleaf-jawr-extension</artifactId>
	<version>2.0.3</version>
</dependency>

Attributes

All attributes need to be prefixed by jawr:.
To avoid IDE warnings you can add the namespace as follows:

<html xmlns:jawr="http://jawr.java.net" xmlns:th="http://www.thymeleaf.org"></html>

Javascript attributes:

Attribute name Type Purpose Default value
src String The bundle path.
useRandomParam Boolean The flag indicating if we must use random parameter in debug mode. true
async Boolean The async flag. false
defer Boolean The defer flag. false
type String The type attribute. text/javascript
crossorigin String The crossorigin attribute.

CSS attributes:

Attribute name Type Purpose Default value
href String The bundle path.
media String The media attribute of the stylesheet. screen
title String The title to use for the style.
useRandomParam Boolean The flag indicating if we must use random parameter in debug mode. true
alternate Boolean This flag is used to render link as an alternate style. false
displayAlternate Boolean This flag is used to render the skin variants of the CSS bundle as alternate style. false

Expression object #jawr

${#jawr.imagePath(String src)}						// base64 defaults to false
${#jawr.imagePath(String src, boolean base64)}

It's important to note that Jawr will generate the base64 encoded image for all browsers except IE6 and IE7, which doesn't handle base64 encoded images.

Usage examples

Javascript bundle:

<script type="text/javascript" src="jquery.min.js" jawr:src="/lib.js"></script>

CSS bundle:

<link rel="stylesheet/less" type="text/css" href="main.less" jawr:href="/all.css" />

Image:

<img src="../resources/img/dummy.png" alt="" th:src="${#jawr.imagePath('/resources/img/dummy.png')}" />

Image input:

<input type="image" src="../resources/img/dummy.png" th:src="${#jawr.imagePath('/resources/img/dummy.png')}" />

You can use expressions as well:

<script type="text/javascript" src="index.js" jawr:src="|/${pageName}.js|"></script>

Versions

Version
2.0.3
2.0.2
2.0.1
2.0.0
2.0.0.BETA02
2.0.0.BETA01
1.2.1
1.2.0
1.1.2
1.1.1
1.1.0
1.0.3
1.0.2
1.0.1
1.0.0