Diverse Hinweise

Attribute Precedence

Thymeleaf befolgt eine Reihenfolge von Schritten, um ein Template zu Rendern. Welche Reihenfolge die einzelnen Schritte haben, sieht man auf der Seite 52 im PDF-Dokument

Der Doctype

In den Templates wird der Doctype verwendet:

<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:th="http://www.thymeleaf.org">
...
</html>

Weil dieser Doctype nicht beim Client erscheinen sollte, wandelt Thymeleaf diesen automatisch um.

Dom Selector Syntax

Siehe Seite 86 und 87 in der Dokumentation für die Verwendung der Dom-Selector-Syntax

Fregments innerhalb von view-beans

Fragments werden mit Spring in einem ThymeleafView definiert. (Für Codebeispiel siehe Seite 29-30)

HTML 5 Syntax

statt der th:*-Syntax kann man auch data-{prefix}-{name} verwenden, z.B. data-th-text. (Neuer Standard in HTML5). Es funktionieren aber beide Lösungen.

Maven mit Proxy einrichten

settings.xml müssen angepasst werden

Inhalt:


    <proxy>
      <id>myproxy</id>
      <active>true</active>
      <protocol>http</protocol>
      <host>igw-axzh.abxsec.com</host>
      <port>8080</port>
    </proxy>

    <proxy>
      <id>myproxy</id>
      <active>true</active>
      <protocol>https</protocol>
      <host>igw-axzh.abxsec.com</host>
      <port>8080</port>
    </proxy>

Quelle: https://maven.apache.org/settings.html#Proxies

Syntax-Hinweis

Der folgende Befehl funktioniert nicht:

<select th:field="*{rows[rowStat.index].variety}">

The problem is that Spring EL does not evaluate variables inside array index brackets, so when executing the above expression we would obtain an error telling us that rows[rowStat.index] (instead of rows[0] , rows[1] , etc) is not a valid position in the rows collection. That’s why preprocessing is needed here.

Alternative:

<select th:field="*{rows[__${rowStat.index}__].variety}">

Übersprungene Kapitel in der Dokumentation

Standart Dokumentation

14 Some more Pages forour Grocery

15 More on Configuration

16 Template Cache

Thymeleaf und Spring

13 Spring WebFlow integration

results matching ""

    No results matching ""