[jira] Created: (VELOCITY-601) escapping when { used doesn't work

View: New views
3 Messages — Rating Filter:   Alert me  

[jira] Created: (VELOCITY-601) escapping when { used doesn't work

by Velocity - Dev mailing list-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

escapping when { used doesn't work
----------------------------------

                 Key: VELOCITY-601
                 URL: https://issues.apache.org/jira/browse/VELOCITY-601
             Project: Velocity
          Issue Type: Bug
    Affects Versions: 1.5
            Reporter: Harald Haas


trying to escape by

\${test test test}

results in

Error while rendering template
org.apache.velocity.exception.ParseErrorException: Encountered " test test}\n" at line 2, column 8 of 26
Was expecting one of:
    "}" ...
    <DOT> ...

        at org.apache.velocity.Template.process(Template.java:137)
        at org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceManagerImpl.java:415)
        at org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(ResourceManagerImpl.java:335)
        at org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:1102)
        at org.apache.velocity.runtime.RuntimeSingleton.getTemplate(RuntimeSingleton.java:324)
        at org.apache.velocity.app.Velocity.mergeTemplate(Velocity.java:473)
        ...

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


[jira] Updated: (VELOCITY-601) escaping when { used doesn't work

by Velocity - Dev mailing list-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ https://issues.apache.org/jira/browse/VELOCITY-601?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Harald Haas updated VELOCITY-601:
---------------------------------

    Summary: escaping when { used doesn't work  (was: escapping when { used doesn't work)

> escaping when { used doesn't work
> ---------------------------------
>
>                 Key: VELOCITY-601
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-601
>             Project: Velocity
>          Issue Type: Bug
>    Affects Versions: 1.5
>            Reporter: Harald Haas
>
> trying to escape by
> \${test test test}
> results in
> Error while rendering template
> org.apache.velocity.exception.ParseErrorException: Encountered " test test}\n" at line 2, column 8 of 26
> Was expecting one of:
>     "}" ...
>     <DOT> ...
> at org.apache.velocity.Template.process(Template.java:137)
> at org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceManagerImpl.java:415)
> at org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(ResourceManagerImpl.java:335)
> at org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:1102)
> at org.apache.velocity.runtime.RuntimeSingleton.getTemplate(RuntimeSingleton.java:324)
> at org.apache.velocity.app.Velocity.mergeTemplate(Velocity.java:473)
> ...

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


[jira] Resolved: (VELOCITY-601) escaping when { used doesn't work

by Velocity - Dev mailing list-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


     [ https://issues.apache.org/jira/browse/VELOCITY-601?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nathan Bubna resolved VELOCITY-601.
-----------------------------------

       Resolution: Later
    Fix Version/s: 2.0

"test test test" is not a valid reference name.  therefore, reference escaping syntax does not work.  i realize that is a bit confusing, but that is why this fails.  the \$ syntax is for escaping valid references.  if you are trying to prevent velocity from considering ${test test test} to be an invalid reference and throwing a parse exception, you should follow the advice given in the JIRA issue which you cloned:

#set( $D = '$' )
$D{test test test}

or (if you use the EscapeTool from VelocityTools):

$esc.d{test test test}

there are no planned or intended updates to the escaping syntax in the 1.x series (i.e. \$ will continue to only work for valid references).  this is something that may well be changed in version 2, though.


> escaping when { used doesn't work
> ---------------------------------
>
>                 Key: VELOCITY-601
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-601
>             Project: Velocity
>          Issue Type: Bug
>    Affects Versions: 1.5
>            Reporter: Harald Haas
>             Fix For: 2.0
>
>
> trying to escape by
> \${test test test}
> results in
> Error while rendering template
> org.apache.velocity.exception.ParseErrorException: Encountered " test test}\n" at line 2, column 8 of 26
> Was expecting one of:
>     "}" ...
>     <DOT> ...
> at org.apache.velocity.Template.process(Template.java:137)
> at org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceManagerImpl.java:415)
> at org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(ResourceManagerImpl.java:335)
> at org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:1102)
> at org.apache.velocity.runtime.RuntimeSingleton.getTemplate(RuntimeSingleton.java:324)
> at org.apache.velocity.app.Velocity.mergeTemplate(Velocity.java:473)
> ...

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...

LightInTheBox - Buy quality products at wholesale price!