Skip to content
Advertisement

How to refer to a static method in Thymeleaf html in java?

I need to use the getMoneyIntoWords() method in the invoice html. But I am getting errors. Refer the code and errors below

// Added below method in MoneyUtil.java

JavaScript

Error:

JavaScript

Advertisement

Answer

You need special syntax to call a static method in Thymeleaf:

JavaScript

You will need to use the full qualified name of the MoneyUtil class.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement