title: How to store string values in context.xml
body: <p>I'd like to store connection URLs in a JNDI binding for my Tomcat application. Since Tomcat uses <code>context.xml</code> for JNDI resource defining, I need to figure out the propert way to store a String (or multiple strings for multiple connections) in <code>context.xml</code>.</p>
  
  <p>My reason for doing this is so that I can define different strings for different environments, and load them through JNDI.</p>
  
  <p>Usually, I see entries like so:</p>
  
  <pre><code>&lt;Context ...&gt;
      &lt;Resource name="someName" auth="Container"
              type="someFullyQualifiedClassName"
              description="Some description."/&gt;
  &lt;/Context&gt;
  </code></pre>
  
  <p>Is it really just as simple as:</p>
  
  <pre><code>&lt;Context ...&gt;
      &lt;Resource name="myConnectionURL" auth="Container"
              type="java.lang.String"
              description="A connection URL string."/&gt;
  &lt;/Context&gt;
  </code></pre>
  
  <p>If so, <strong>where do I actually store the String value?!?!</strong> And if it's not correct, then what is the proper way for me to store, for instance, "<code>amqp:5272//blah.example.com&amp;param1=4</code>" in <code>context.xml</code> so I could then look it up like so:</p>
  
  <pre><code>Context ctx = new InitialContext();
  String connectionURL = (String)ctx.lookup("myConnectionURL");
  </code></pre>
  
  <p>Thanks in advance!</p>