You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Kabe Robichaux <ka...@oracle.com> on 2004/05/21 00:12:48 UTC
#set directive map example
In the UserGuide section "Directives" sub-section "set" it shows an
example for creating a map:
#set( $monkey.Map = {"banana" : "good", "roast beef" : "bad"}) ## Map
If you have this template you will get the following exception:
org.apache.velocity.exception.ParseErrorException: Lexical error:
org.apache.velocity.runtime.parser.TokenMgrError: Lexical error at line
1, column 21. Encountered: "{" (123), after : ""
at org.apache.velocity.Template.process(Template.java:141)
at
org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceManagerImpl.java:423)
at
org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(ResourceManagerImpl.java:341)
at
org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:831)
at
org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:813)
at
org.apache.velocity.runtime.RuntimeSingleton.getTemplate(RuntimeSingleton.java:285)
at org.apache.velocity.app.Velocity.getTemplate(Velocity.java:469)
at stg.arcane.tools.codegen.Main.main(Main.java:49)
Is there something wrong with the syntax used in the UserGuide? Is this
feature even available?
....
Kabe
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org
Re: #set directive map example
Posted by Geir Magnusson Jr <ge...@4quarters.com>.
On May 20, 2004, at 6:12 PM, Kabe Robichaux wrote:
> In the UserGuide section "Directives" sub-section "set" it shows an
> example for creating a map:
>
> #set( $monkey.Map = {"banana" : "good", "roast beef" : "bad"}) ## Map
>
> If you have this template you will get the following exception:
>
> org.apache.velocity.exception.ParseErrorException: Lexical error:
> org.apache.velocity.runtime.parser.TokenMgrError: Lexical error at
> line 1, column 21. Encountered: "{" (123), after : ""
> at org.apache.velocity.Template.process(Template.java:141)
> at
> org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(R
> esourceManagerImpl.java:423)
> at
> org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(Re
> sourceManagerImpl.java:341)
> at
> org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance
> .java:831)
> at
> org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance
> .java:813)
> at
> org.apache.velocity.runtime.RuntimeSingleton.getTemplate(RuntimeSinglet
> on.java:285)
> at org.apache.velocity.app.Velocity.getTemplate(Velocity.java:469)
> at stg.arcane.tools.codegen.Main.main(Main.java:49)
>
> Is there something wrong with the syntax used in the UserGuide? Is
> this feature even available?
In CVS. Not released yet. So get a nightly, or build from CVS.
geir
>
> ....
> Kabe
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>
--
Geir Magnusson Jr 203-247-1713(m)
geir@4quarters.com
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org