Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Map in velocity context

    Hi,

    I'm trying to access a map I've added in the template context of a select custom query:

    Code:
    HashMap<String, String> severityLocalizer = new HashMap<String, String>();
    [...]
    req.addToTemplateContext("sevMapper", severityLocalizer);
    return super.executeFetch(req);
    I tried various ways to access the map (based on my experience, and then on the velocity documentation):

    $sevMapper.key
    $sevMapper.get("key")
    $sevMapper["key"]
    ${sevMapper.get("key")}
    etc...

    Did I miss something ? How can I access that map from my custom query ? I've also tried using the $rawValue prefix, no success...

    Many thanks for your help,

    Thomas

    #2
    Those are all fine, so the problem is most likely that the map has not actually been add to the template context (eg the code you thought was running did not, or ran for a different dsRequest), or the Map is empty.

    Comment

    Working...
    X