How to call a static method ??
See original GitHub issueFor some reason , I want to call a static method in html template , I use the code just like the example:
<p th:text="${@myapp.translator.Translator@translateToFrench('textVar')}">
it’s an ordinary OGNL expression, but it does not work. I got the error like this:
org.springframework.expression.spel.SpelParseException: EL1041E:(pos 29): After parsing a valid expression, there is still more data in the expression: 'bean_ref(@)'
so any help here to resolve the question when I call a static method , and a method of a isntance?
Issue Analytics
- State:
- Created 6 years ago
- Comments:18 (1 by maintainers)
Top Results From Across the Web
Static vs. Non-Static Methods in Java - Study.com
To create a static method in Java, you prefix the key word 'static' before the name of the method. A static method belongs...
Read more >Static methods vs Instance methods in Java - GeeksforGeeks
Static methods are the methods in Java that can be called without creating an object of class. They are referenced by the class...
Read more >calling static method in java [duplicate] - Stack Overflow
Static methods can be called via the classname or an instance. I would try to avoid to call them by an ...
Read more >Master the Concept of Static Methods in Java - DataFlair
4. We can invoke a static method by using its class reference. An instance method is invoked by using the object reference. 5....
Read more >Python Static Method Explained With Examples - PYnative
A static method is a general utility method that performs a task in isolation. Static methods in Python are similar to those found...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think you want to use
T()
with the full class name, likeworks well.