Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It's possible! You need to use the <code>util</code> namespace in your <code>app-servlet.xml</code> as below:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:context="http://www.springframework.org/schema/context" xmlns:util="http://www.springframework.org/schema/util" xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.2.xsd"&gt; &lt;util:properties id="props" location="classpath:yourfile.properties" /&gt; &lt;!-- other --&gt; &lt;/beans&gt; </code></pre> <p>And your <code>controller</code> is something like</p> <pre><code>@org.springframework.beans.factory.annotation.Value("#{props.key1}") public void setFoo(String foo) { System.out.println("props.key1: " + foo); } </code></pre> <p><strong>update</strong> for another way:</p> <p>You also can use namespace <code>context</code></p> <pre><code>&lt;context:property-placeholder location="classpath:yourfile.properties" /&gt; </code></pre> <p>In controller, declare a property as below</p> <pre><code>@Value("${pros.key1}") private String foo; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload