velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Creating maps on the fly
Date Wed, 22 Dec 2010 21:07:22 GMT
All,

Using Velocity 1.4, I'm trying to create an in-page hash for quick
lookups. I have the following syntax:

#set($hash = { })

This is causing an error:

org.apache.velocity.exception.ParseErrorException: Lexical error:
org.apache.velocity.runtime.parser.TokenMgrError: Lexical error at line
6, column 17.  Encountered: &quot;{&quot; (123), after : &quot;&quot;
	at org.apache.velocity.Template.process(Template.java:141)
	at
org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceManagerImpl.java:423)
    ...

I've even tried #set($hash = { "":"" }) just in case empty hashes aren't
supported, and I get a similar error.

When was this syntax added to Velocity? Am I just running a version that
is too old?

Thanks,
-chris


Mime
View raw message