Refer to enum in Thymeleaf

enum


package com.example;

public enum Months {
    JANUARY, FEBRUARY, MARCH, APRIL, MAY, JUNE, JULY, AUGUST, SEPTEMBER, OCTOBER, NOVEMBER, DECEMBER;
}

thymeleaf


<div th:if="${month == T(com.example.Months).JANUARY}">
Displayed when month is JANUARY
</div>

reference

Recommended Posts

Refer to enum in Thymeleaf
JUnit 5: How to write test cases in enum
Introduction to Ratpack (9) --Thymeleaf
To debug in eclipse
How to embed JavaScript variables in HTML with Thymeleaf
[Ruby on Rails] How to write enum in Japanese
Handle Enum in Mybatis TypeHandler
Refer to C ++ in the Android Studio module (Java / kotlin)
[Rails] How to use enum
How to use Java enums (Enum) in MyBatis Mapper XML
Enum Strategy pattern in Java
Reproduce Java enum in C #
Format Timestamp type in Thymeleaf
Ubuntu unable to log in
[Rails / Routing] How to refer to the controller in the directory you created
Precautions when using checkboxes in Thymeleaf
Draw screen with Thymeleaf in SpringBoot
How to use Lombok in Spring
How to find May'n in XPath
How to hide scrollbars in WebView
How to iterate infinitely in Ruby
Try to implement Yubaba in Ruby
Output JavaScript in Thymeleaf 3 without escaping
Multithreaded to fit in [Java] template
Introduction to algorithms in java-cumulative sum
How to run Ant in Gradle
How to master programming in 3 months
How to learn JAVA in 7 days
How to get parameters in Spark
How to install Bootstrap in Ruby
Log output to file in Java
How to use InjectorHolder in OpenAM
Switch from JSP + JSTL to Thymeleaf
How to introduce jQuery in Rails 6
How to use classes in Java?
How to name variables in Java
How to set Lombok in Eclipse
Try to implement Yubaba in Java
Tips for handling enums in thymeleaf
Things to note in conditional expressions
Thymeleaf usage notes in Spring Boot
Best Gaming Products To Buy In 2021
How to use Java enum type
How to concatenate strings in java
How to install Swiper in Rails
What to do if you get a groovy warning in Thymeleaf Layout
Sample code to serialize and deserialize Java Enum enums and JSON in Jackson
Create your own dialect to convert line feed code to line feed tag in Thymeleaf3
If you want to dynamically embed values & add text to attribute values in Thymeleaf 3