snipt

Ctrl+h for KB shortcuts

XML

Spring Profiles

1
2
3
4
5
6
7
8
<beans profile="dev,stage,prod">
  <jee:jndi-lookup id="datasource" jndi-name="java:poolDS" />
</beans>

<!-- Defaults to 'none'. Becomes active when no profile is defined. -->
<beans profile="">
  <jee:jndi-lookup id="datasource" jndi-name="java:localPoolDS" />
</beans>
https://snipt.net/embed/91488efe73d3572f738a8884bbf0b427/
https://snipt.net/raw/91488efe73d3572f738a8884bbf0b427/
91488efe73d3572f738a8884bbf0b427
xml
XML
8
2016-09-16T16:44:38
True
False
False
/api/public/snipt/50045/
spring-profiles-1
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a> <a href="#L-8">8</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="nt">&lt;beans</span> <span class="na">profile=</span><span class="s">&quot;dev,stage,prod&quot;</span><span class="nt">&gt;</span> </span><span id="L-2"><a name="L-2"></a> <span class="nt">&lt;jee:jndi-lookup</span> <span class="na">id=</span><span class="s">&quot;datasource&quot;</span> <span class="na">jndi-name=</span><span class="s">&quot;java:poolDS&quot;</span> <span class="nt">/&gt;</span> </span><span id="L-3"><a name="L-3"></a><span class="nt">&lt;/beans&gt;</span> </span><span id="L-4"><a name="L-4"></a> </span><span id="L-5"><a name="L-5"></a><span class="c">&lt;!-- Defaults to &#39;none&#39;. Becomes active when no profile is defined. --&gt;</span> </span><span id="L-6"><a name="L-6"></a><span class="nt">&lt;beans</span> <span class="na">profile=</span><span class="s">&quot;&quot;</span><span class="nt">&gt;</span> </span><span id="L-7"><a name="L-7"></a> <span class="nt">&lt;jee:jndi-lookup</span> <span class="na">id=</span><span class="s">&quot;datasource&quot;</span> <span class="na">jndi-name=</span><span class="s">&quot;java:localPoolDS&quot;</span> <span class="nt">/&gt;</span> </span><span id="L-8"><a name="L-8"></a><span class="nt">&lt;/beans&gt;</span> </span></pre></div> </td></tr></table>
Spring
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.