velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tomek Maćkowski <tmackow...@gmail.com>
Subject Re: Escapng problem
Date Wed, 07 Dec 2005 08:08:04 GMT
Thanks for response

I tried :

#set( $d = '$' )
arg1value="$d{var:maxlength}"

but result is still 


 [java] org.apache.velocity.exception.ParseErrorException:
Encountered ":maxlength}\"\r\n" at line 25, column 49.
     [java] Was expecting one of:
     [java] "}" ...
     [java] <DOT> ...



Nathan Bubna napisał(a):

>#set( $d = '$' )
>arg1value="$d{var:maxlength}"
>
>or if you have the EscapeTool in the context (from VelocityTools)
>
>arg1value="$esc.d{var:maxlength}"
>
>\$foo is for escaping _references_ not for escaping the $ character. 
>velocity was still trying to parse it as a reference.
>
>On 12/5/05, Tomek Maćkowski <tmackowski@gmail.com> wrote:
>  
>
>>Hi
>>
>>I have a problem with escaping '$' character in Velocity
>>
>>I want to produce literal:
>>arg1value="${var:maxlength}"
>>
>>When i type it in my template "as is" I recive an exception:
>>
>>     [java] org.apache.velocity.exception.ParseErrorException:
>>Encountered ":maxlength}\"\r\n" at line 25, column 49.
>>     [java] Was expecting one of:
>>     [java] "}" ...
>>     [java] <DOT> ...
>>
>>
>>When I type
>>
>>arg1value="\${var:maxlength}"
>>
>>result is the same.
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>>
>>
>>    
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Mime
View raw message