Hi,
Ravikanth L wrote:
Hi All,
I would like to know the valid characters that we can use for a value in
VTL. I tried the following
#set($var = "My string with special chars##")
Velocity defines a line-comment starting with the characters ##
Also note that Velocity offers a feature called "string interpolation",
where within a directive (#if and #set) the references inside double
quotes are evaluated and inserted.
You have detected a parser bug, where it chokes on the fact that the
EOL-comment is not compatible with the interpolation.
Please consider using single quotes or using a failsafe escaping:
#set( $var = 'My string with special chars##' )
#set( $H = '#' )
#set( $var = "My string with special chars$H$H" )
I am aware of some issues that are related to the problem (maybe you can
vote on them):
http://issues.apache.org/jira/browse/VELOCITY-126 "String containing '##' is treated
as unterminated String"
http://issues.apache.org/jira/browse/VELOCITY-355 "lost '#'s inside
#literal()/#end"
http://issues.apache.org/jira/browse/VELOCITY-272 "EOF exception when last line is
commented out and has no new line at end"
http://issues.apache.org/jira/browse/VELOCITY-253 "Enhance whitespace gobbling"
- involves parser syntax simplification
Hope this helped,
Christoph
It throws ParseErrorrException as:
org.apache.velocity.exception.ParseErrorException: Lexical error:
org.apache.velocity.runtime.parser.TokenMgrError: Lexical error at line 1,
column 19. Encountered: <EOF> after : "".
It didn't complain if i use single #. So, i would like to know what all
character combinations will result in ParserErrorException without any
escaping done, bcoz we are reading variable names and their values from an
XML file and constructing variables dynamically using RenderTool.
Tried to find in User docs but no luck.
Can anyone pls let me know the list or point me to the link where i can get
the details.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]