java - Stringtemplate compare strings does not work -


can explain why not work ?

stringtemplate query = new stringtemplate("hello " +                   "$if(param==\"val1\")$" +                   " works! " +                   "$endif$ " +                   "world");           query.setattribute("param", "val1");           system.out.println("result: "+query.tostring());   

it throws

eval tree parse error :0:0: unexpected end of subtree @ org.antlr.stringtemplate.language.actionevaluator.ifcondition(actionevaluator.java:815) @ org.antlr.stringtemplate.language.conditionalexpr.write(conditionalexpr.java:99)

st doesn't allow computation in templates. make part of model.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -