Velocity
  1. Velocity
  2. VELOCITY-264

Escaping in form of "$\!{foo}" does not work

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Later
    • Affects Version/s: 1.4
    • Fix Version/s: 2.x
    • Component/s: Engine
    • Labels:
      None
    • Environment:
      Operating System: All
      Platform: PC

      Description

      Below are the results of executing app_example1 with a modified "example.vm"
      file. The content of the example.vm is a copy-paste from Velocity Userâ??s Guide
      (see the URL). Note that "$!

      {foo}" was rendered to "$Unable to render embedded object: File ({", instead of "$) not found.{foo}

      "
      as expected:

      D:\dev\velocity-1.4\examples\app_example1>type example.vm
      #set( $foo = "bar" )
      $!foo
      $!

      {foo}

      $
      !foo
      $\\\!foo

      D:\dev\velocity-1.4\examples\app_example1>example
      Using classpath: .;..\..\bin\velocity-1.4.jar;..\..\bin\velocity-dep-1.4.jar
      $!foo
      $!{
      $!foo
      $
      !foo
      D:\dev\velocity-1.4\examples\app_example1>

      Surprisingly, I could really use this feature as I want to evaluate my
      template in two steps: cache the result of the first generic step and then
      reuse it to generate various final messages.

        Issue Links

          Activity

          Hide
          Will Glass-Husain added a comment -

          Thanks for reporting this. Putting this on the list for 1.5

          Show
          Will Glass-Husain added a comment - Thanks for reporting this. Putting this on the list for 1.5
          Hide
          Henning Schmiedehausen added a comment -

          Yes, this is due to the weird parser magic in respect to escaping and comments. This is due to a really big cleanup in 2.0. For the moment, this is more of a "don't try this at home, kid" problem. We also need to add a note to the docs about this.

          Show
          Henning Schmiedehausen added a comment - Yes, this is due to the weird parser magic in respect to escaping and comments. This is due to a really big cleanup in 2.0. For the moment, this is more of a "don't try this at home, kid" problem. We also need to add a note to the docs about this.

            People

            • Assignee:
              Unassigned
              Reporter:
              oleg
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development