Reputation: 21
For example, the value of the attribute <greeting>
is "Hello, world!".
What I want is to check whether the <greeting>
starts with "Hello", if so, apply template <response>
.
My string template snippet:
<if(/*do not know how to write the condition here*/)><greeting:response()><endif>
Upvotes: 1
Views: 187
Reputation: 99889
The expression you're after violates one of the core principles of the strict model-view separation in StringTemplate. No such expression exists by design, so you'll need to place the condition somewhere in your Java code which uses the templates.
Upvotes: 1