Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Not A Problem
-
2.0
-
None
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!