Marco Schoolenberg wrote:
>
> I seem to remember that escaping the character is the Normal thing to
> do...
>
In "User Guide" said:
Velocity User Guide wrote:
>
> VTL directives can be escaped with the backslash character ("\") in a
> manner similar to valid VTL references.
>
But using this template:
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE form-validation PUBLIC "-//Apache Software Foundation//DTD
> Commons Validator Rules Configuration 1.1.3//EN"
> "http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd">
> <form-validation>
> <arg2 key="\${var:maxlength}" name="maxlength" resource="false" />
> </form-validation>
>
Return this error:
> org.apache.velocity.exception.ParseErrorException: Encountered
> ":maxlength}\" name=\"maxlength\" resource=\"false\"
> />\n</form-validation>\n" at line 4, column 18.
> Was expecting one of:
> "}" ...
> <DOT> ...
>
> at org.apache.velocity.Template.process(Template.java:141)
>
Using this template all go ok (special attention in removed character $):
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE form-validation PUBLIC "-//Apache Software Foundation//DTD
> Commons Validator Rules Configuration 1.1.3//EN"
> "http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd">
> <form-validation>
> <arg2 key="{var:maxlength}" name="maxlength" resource="false" />
> </form-validation>
>
So, in conclusion, "$" it's not escaped with "\" character.
I'm using velocity 1.4
Thank's
--
View this message in context:
http://www.nabble.com/How-to-keep-%27%24%27-Char-in-.vm-files--tf4038353.html#a12376953
Sent from the Velocity - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]