Reputation: 12356
I'm trying to make a lookup to a hash table m.notes
using concatenated value of position.qid
and literal ".qid"
like this:
$tag(name="itemId", content=m.notes.(position.qid".qid").itemId)$
I tried different options, but I get runtime error. Can someone correct my syntax?
Upvotes: 2
Views: 859
Reputation: 1591
Put the 2 items in an array. StringTemplate concatenates all items in an array (or as they call it, a multi-valued-attribute) when it executes a ToString() on it.
[position.qid, ".qid"]
So, if position.qid evaluates to "hello", this expression would become
hello.qid
.
Upvotes: 3
Reputation: 1
in template group, I can do like this, first, define a concantenate template: concantenate(substr)::="" then use as following (concantenate([position.qid,".qid"]))
Upvotes: 0
Reputation: 2093
Not sure whether such concatenation is possible in string template. Why don't you use a different method that could do the concatenation and return the value.
e.g:
position.fullQid
instead of position.qid
where,
public String getFullQid(){
return getQid() + ".qid";
}
Upvotes: 1