Thursday, 1 December 2011

Spring properties, XML and annotation

  <util:properties id="config" location="classpath:config.properties" />

---

  <bean id="directoryDao" class="bla.bla.Bla">
    <constructor-arg>
      <value>#{config['jcdListPath']}</value>
    </constructor-arg>
  </bean>

---

  @Value("#{config['javadocTreeUrl']}")
  private String javadocTreeUrl;

  @RequestMapping("/buildJavadoc")
  public String buildJavadoc()  {
    return "redirect:" + javadocTreeUrl;
  }