Uploaded image for project: 'Velocity Tools'
  1. Velocity Tools
  2. VELTOOLS-151

is the "application" a reserved word in the EscapeTool?

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 2.0
    • None
    • GenericTools

    Description

      Recently, I use apache velocity for view template in spring framework, and in order to escape the HTML entity, I introduced the "org.apache.velocity.tools.generic.EscapeTool", however, then I found the variable named with "$application" cannot work now, that any variable named with "$application" shows blank, e.g. "$!application.name".

      When I removed the velocity tool configuration, "$application" can be read correctly. So anyone knows if the "$application" a reserved word in velocity escape tool or I make a mistake when configuration?

      Toolbox config:
      <?xml version="1.0" encoding="UTF-8"?>
      <toolbox>
      <tool>
      <key>esc</key>
      <scope>application</scope>
      <class>org.apache.velocity.tools.generic.EscapeTool</class>
      </tool>
      </toolbox>

      Config in spring-beans XML:
      <bean id="viewResolver" class="org.springframework.web.servlet.view.velocity.VelocityViewResolver">
      <property name="cache" value="true" />
      <property name="exposeSpringMacroHelpers" value="true" />
      <property name="toolboxConfigLocation" value="/WEB-INF/toolbox.xml" />
      </bean>

      In template file:
      <div class="description">
      <h2>Application Nameļ¼š$!application.name</h2>
      </div>

      Thanks in advance!

      Attachments

        Activity

          People

            Unassigned Unassigned
            jamee jamee.wang
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: