title: reading properties file in jsp using annotation spring 4
body: <p>I need to do this, with annotation, withouth using xml file.</p>
  
  <pre><code>&lt; bean id="placeholderConfig"       class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" &gt;
          &lt; property name="locations" &gt;
              &lt; list &gt;
                  &lt; value &gt;app.properties&lt; / value &gt;
              &lt; / list &gt;
          &lt; / property &gt;
  &lt; / bean &gt;
  </code></pre>
  
  <p>And I need to call my property values in my jsp like <code>${test.name}</code> (where test.name is configured in app.properties)</p>
  
  <p>Now I do this</p>
  
  <pre><code>@PropertySource(value="app.properties", ignoreResourceNotFound=true)
  ...
  @Bean(name="placeholderConfig")
      public static PropertySourcesPlaceholderConfigurer placeholderConfigurer(){
          PropertySourcesPlaceholderConfigurer cfg = new PropertySourcesPlaceholderConfigurer();
          cfg.setLocation(new ClassPathResource("app.properties"));
          cfg.setIgnoreUnresolvablePlaceholders(true);
          return cfg;
      }
  </code></pre>
  
  <p>In this way i can access whith</p>
  
  <pre><code>@Value("${test.name}")
      String name; //contain value of test.name configured in app.properties
  </code></pre>
  
  <p>But if i do ${test.name} in my jsp, this is not read.
  To let jsp read the value I have to do (in my java class)</p>
  
  <pre><code>@Value("${test.name}")
      String name;
  ...
  model.addObject("name", name);
  </code></pre>
  
  <p>There is a way to access directly to my property from my jsp, whit <code>${test.name}</code> code?</p>