You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "jamee.wang (Created) (JIRA)" <de...@velocity.apache.org> on 2012/01/12 03:39:40 UTC
[jira] [Created] (VELTOOLS-151) is the "application" a reserved
word in the EscapeTool?
is the "application" a reserved word in the EscapeTool?
-------------------------------------------------------
Key: VELTOOLS-151
URL: https://issues.apache.org/jira/browse/VELTOOLS-151
Project: Velocity Tools
Issue Type: Bug
Components: GenericTools
Affects Versions: 2.1
Reporter: jamee.wang
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!
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org
[jira] [Closed] (VELTOOLS-151) is the "application" a reserved word
in the EscapeTool?
Posted by "Nathan Bubna (Closed) (JIRA)" <de...@velocity.apache.org>.
[ https://issues.apache.org/jira/browse/VELTOOLS-151?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nathan Bubna closed VELTOOLS-151.
---------------------------------
> is the "application" a reserved word in the EscapeTool?
> -------------------------------------------------------
>
> Key: VELTOOLS-151
> URL: https://issues.apache.org/jira/browse/VELTOOLS-151
> Project: Velocity Tools
> Issue Type: Bug
> Components: GenericTools
> Affects Versions: 2.1
> Reporter: jamee.wang
> Labels: EscapeTool
>
> 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!
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org
[jira] [Resolved] (VELTOOLS-151) is the "application" a reserved
word in the EscapeTool?
Posted by "Nathan Bubna (Resolved) (JIRA)" <de...@velocity.apache.org>.
[ https://issues.apache.org/jira/browse/VELTOOLS-151?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nathan Bubna resolved VELTOOLS-151.
-----------------------------------
Resolution: Not A Problem
This is a question, not a bug or feature request. Next time send questions to user@velocity.apache.org
For the record, no, EscapeTool does not reserve any terms. VelocityTools does treat $application as significant (i.e. returns the ServletContext for that), but by default (in Tools 2.x, at least) user-set values take precedence over automatic servlet api and tool references (e.g. $application).
> is the "application" a reserved word in the EscapeTool?
> -------------------------------------------------------
>
> Key: VELTOOLS-151
> URL: https://issues.apache.org/jira/browse/VELTOOLS-151
> Project: Velocity Tools
> Issue Type: Bug
> Components: GenericTools
> Affects Versions: 2.1
> Reporter: jamee.wang
> Labels: EscapeTool
>
> 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!
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org