Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can specify the changing property outside of the web.xml by using Tomcat's <a href="http://tomcat.apache.org/tomcat-6.0-doc/jndi-resources-howto.html" rel="nofollow noreferrer">JNDI support</a>.</p> <p>For example, specify an environment entry within a <a href="http://tomcat.apache.org/tomcat-6.0-doc/config/context.html" rel="nofollow noreferrer">Context</a> element:</p> <pre><code>&lt;Context ...&gt; ... &lt;Environment name="maxExemptions" value="10" type="java.lang.Integer" override="false"/&gt; ... &lt;/Context&gt; </code></pre> <p>Then specify a link to this environment variable in your web.xml: </p> <pre><code>&lt;env-entry&gt; &lt;env-entry-name&gt;maxExemptions&lt;/param-name&gt; &lt;env-entry-type&gt;java.lang.Integer&lt;/env-entry-type&gt; &lt;/env-entry&gt; </code></pre> <p>And then call from your code using (from <a href="http://www.wrox.com/WileyCDA/WroxTitle/productCd-0471753610.html" rel="nofollow noreferrer">Professional Apache Tomcat 6</a>):</p> <pre><code>private final Object lock = new Object(); ... synchronized (lock) { Context initCtx = new InitialContext(); Context envCtx = initCtx.lookup("java:comp/env"); Integer maxExemptions = (Integer) envCtx.lookup("maxExemptions"); } </code></pre> <p>Or you can inject your value into your application with Spring using <a href="http://static.springframework.org/spring/docs/2.5.x/reference/xsd-config.html#xsd-config-body-schemas-jee-jndi-lookup" rel="nofollow noreferrer"><code>&lt;jndi-lookup /&gt;</code></a></p> <pre><code>&lt;bean id="someBean"&gt; &lt;property name="maxExemptions"&gt; &lt;jndi-lookup jndi-name="xxx" /&gt; &lt;/property&gt; &lt;/bean&gt; </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.
    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