Uploaded image for project: 'Velocity'
  1. Velocity
  2. VELOCITY-743

The character ":" if present within the curly braces of a variable throws exception

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Won't Fix
    • 1.6.2
    • None
    • Engine
    • None
    • JRE 6, Apache tomcat 6.0.18

    Description

      I am trying to write a template that is customized like this
      -----------------------------------------------------------------------------
      <hi>
      <variable1> ${EPL_JOBTITLE:varB_EPL} </variable1>
      <variable2>${SPL_EMPLOYEENUMBER:varA_SPL} </variable2>
      </hi>
      -----------------------------------------------------------------------------

      Now the ${EPL_JOBTITLE:varB_EPL} is custom parsed and replaced with the appropriate values in the context.
      However, as soon as the Template is loaded by the velocity engine I get a

      Template Parse Exception :
      Encountered ":varB_EPL}\r\n\r\n\r\n" at MY Script - 1\Test this.vm[line 1, column 15]
      Was expecting one of:
      "}" ...
      <DOT> ...

      How is the ":" character an invalid one within braces ? Shouldn't it be supported within a variable name?

      Attachments

        Activity

          People

            cbrisson Claude Brisson
            vinay_s Vinay
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: