[stringtemplate-interest] Inconsistent handling of multi-valued attributes?
Steve Ims
steve_ims at yahoo.com
Sun Feb 25 00:56:00 PST 2007
Hi,
I'm using the latest ST Java APIs. The first/last/rest operators don't work as I expected them to ... wondering if it's user error/misperception, or a bug?
Here's an example:
StringTemplate hello = new StringTemplate("Hello, $first(name/foo)$ $first(name/bar)$");
Map m = new HashMap();
m.put("name/foo", new String[]{"World","Mary","Bob"});
hello.setAttributes(m);
hello.setAttribute("name/bar", new String[]{"World","Mary","Bob"});
System.out.println(hello.toString());
My expected result:
Hello, World World
Observed result:
Hello, [Ljava.lang.String;@53f853f8 World
Suggestions? Thanks.
-- Steve
____________________________________________________________________________________
Food fight? Enjoy some healthy debate
in the Yahoo! Answers Food & Drink Q&A.
http://answers.yahoo.com/dir/?link=list&sid=396545367
More information about the stringtemplate-interest
mailing list