I have to use JEXL expression and I need to get current year and month using JEXL. Is it possible?
Asked
Active
Viewed 3,408 times
1 Answers
1
You can use JETT which allow to invoke static methods in JEXL code:
ETT extends JEXL to allow references to static methods directly in JEXL Expressions
Then you can call (Java 8) LocalDateTime.now method to get current date and time:
${java.time.LocalDateTime.now()}

Ori Marko
- 56,308
- 23
- 131
- 233
-
1I am using Apache-Syncope. It prevents using JETT in JEXL expretions... Is there any way without using java? – alireza ranjbaran May 24 '18 at 17:02
-
can you provide a snippet code of this example ? I've installed JETT but I still having error on executing ${java.time.LocalDateTime.now()} – Kenji Mukai Jul 15 '21 at 22:05