“thymeleaf th: falls Beispiel” Code-Antworten

thymeleaf th: falls Beispiel

<td>
    <span th:if="${teacher.gender == 'F'}">Female</span>
    <span th:unless="${teacher.gender == 'F'}">Male</span>
</td>
Tame Tortoise

thymeleaf th: falls Beispiel

<td th:text="${teacher.active} ? 'ACTIVE' : 'RETIRED'" />
Balaji Rengan

thymeleaf th: falls Beispiel

public class Teacher implements Serializable {
    private String gender;
    private boolean isActive;
    private List<String> courses = new ArrayList<>();
    private String additionalSkills;
Balaji Rengan

thymeleaf th: falls Beispiel

<dependency>
    <groupId>org.thymeleaf</groupId>
    <artifactId>thymeleaf</artifactId>
    <version>3.0.11.RELEASE</version>
</dependency>
<dependency>
    <groupId>org.thymeleaf</groupId>
    <artifactId>thymeleaf-spring5</artifactId>
    <version>3.0.11.RELEASE</version>
</dependency>
Balaji Rengan

thymeleaf th: falls Beispiel

<td th:text="${teacher.additionalSkills} ?: 'UNKNOWN'" />
Balaji Rengan

thymeleaf th: falls Beispiel

<td th:switch="${#lists.size(teacher.courses)}">
    <span th:case="'0'">NO COURSES YET!</span>
    <span th:case="'1'" th:text="${teacher.courses[0]}"></span>
    <div th:case="*">
        <div th:each="course:${teacher.courses}" th:text="${course}"/>
    </div>
</td>
Balaji Rengan

Ähnliche Antworten wie “thymeleaf th: falls Beispiel”

Fragen ähnlich wie “thymeleaf th: falls Beispiel”

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen