Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7075825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:13:27+00:00 2026-05-28T06:13:27+00:00

Recently, I use apache velocity for view template in spring framework, and in order

  • 0

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:

<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!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T06:13:27+00:00Added an answer on May 28, 2026 at 6:13 am

    The EscapeTool does not put anything in the context, so it is not overriding your $application variable. To find out what is overriding any variable, you might try

    $application.class.name
    

    VelocityTools does automatically return the servletContext when $application is used in a template, but (in the case of Tools 2.0) you can configure whether you want to prefer user-set variables (the default) or the servlet api objects. I don’t offhand recall if that can be configured in Tools 1.4, but i’m sure you can look it up.

    In any case, in Tools 2.x, it is not reserved, but it is also does come with a default value. Since it is acting as those it’s reserved, i’m guessing you either turned off userOverwrite or else are using Tools 1.4.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am quite familiar with Smarty and recently decided to use Zend framework in
I've been trying to use Apache Sling's Scala 2.8 Script Engine recently updated last
We have several applications that use Apache HTTPClient 3 to make HTTP requests. Recently
I've recently switched my Tomcat server to use AJP fronted by Apache. In the
I'm fairly new to the Spring framework. I have recently installed SpringSource Tool Suite
Recently I use NSTimer to repeat taking photos, it'll show on the screen. This
Recently I use data binding to speed up my development of C# winforms application.
I tried recently to use NAnt (beta 0.86.2962.0) to run some unit tests compiled
Recently I started to use Eclipse's java compiler, because it is significantly faster than
Recently saw someone commending another user on their use of sizeof var instead of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.