title: Java Servlets - Storing a list of values in web.xml (multiple param-value's for single param-name)
body: <p>I'm creating a servlet that needs to load configuration information. Part of the configuration information I need is a list of Strings (specifically, a list of hostnames and/or URLs).</p>
  
  <p>I was hoping to store this information in my servlet's web.xml file (so I don't have to write my own parser) as either a context-param or init-param; essentially multiple param-value's for a single param-name.</p>
  
  <p>Example of what I would like:</p>
  
  <pre><code>&lt;context-param&gt;
      &lt;param-name&gt;validHosts&lt;/param-name&gt;
      &lt;param-value&gt;example1.com&lt;/param-value&gt;
      &lt;param-value&gt;example2.com&lt;/param-value&gt;
      &lt;param-value&gt;example3.com&lt;/param-value&gt;
  &lt;/context-param&gt;
  </code></pre>
  
  <p>My initial research seems to indicate this is not possible--that there can only be a single param-value for any param-name (within either context-param or init-param).</p>
  
  <p>I know I could just use a delimited list within a single param-value, but is that really my only option if I still want to use web.xml?  Should I just stop whining and write my own config file parser?</p>