I have the following Map with some attributes to be used in a template
Map<String,String> attributes = new HashMap<String,String>();
attributes.put("attr1.val","foo");
attributes.put("attr2.val","bar");
In the template, if I refer to them as follows:
<b>$attr1.val$: $attr2.val$</b>
StringTemplate assumes that I am dereferencing a property on attr1. Escaping the dot ($attr1\.val$
) doesn't seem to work either. The documentation doesn't seem to provide a clue on how or if this is possible.
Do I just have to change my delimiter to something other than a dot?
Glancing at the manual this is covered under Difficult Property Names:
Difficult properties names are quite likely to occur when dealing with maps. Map keys can be defined using arbitrary strings, including spaces and syntax characters used to defined templates themselves.