Reputation: 22017
I have a constant for a name.
public static final NAME_SOME = "some"
In my html I tried,
<input th:value="${T(the.package.TheClass).NAME_SOME}"/>
I expected the actual value from the model named by some
.
Yet I see value=some
.
How can I fix this?
Upvotes: 0
Views: 961
Reputation: 20487
It's a bit unclear what you're asking. The expression <input th:value="${T(the.package.TheClass).NAME_SOME}" />
should indeed evaluate to <input value="some" />
. You mean you have a form with a model object and you want to bind it to the expression model.some
? You can use preprocessing to do that, I think...
<input th:field="*{__${T(the.package.TheClass).NAME_SOME}__}" />
Upvotes: 3