title: SpringBoot - Websphere - Java Config - web.xml - resource-ref
body: <p>I have a web application where I have 3 jndi resources defined in the web.xml
  1 for the database and 2 for dyna cache</p>
  
  <p>How can I convert it into Java configuration in Spring boot.</p>
  
  <p>Following is the sample resource ref configuration in the application</p>
  
  <pre><code>&lt;resource-ref&gt;
      &lt;description&gt;Resource reference for database&lt;/description&gt;
      &lt;res-ref-name&gt;jdbc/dbname&lt;/res-ref-name&gt;
      &lt;res-type&gt;javax.sql.DataSource&lt;/res-type&gt;
      &lt;res-auth&gt;Container&lt;/res-auth&gt;
      &lt;res-sharing-scope&gt;Shareable&lt;/res-sharing-scope&gt;
  &lt;/resource-ref&gt;
  
  &lt;resource-ref id="cache1"&gt;
      &lt;description&gt;cache1 description&lt;/description&gt;
      &lt;res-ref-name&gt;cache/cache1&lt;/res-ref-name&gt;
      &lt;res-type&gt;com.ibm.websphere.cache.DistributedMap&lt;/res-type&gt;
      &lt;res-auth&gt;Container&lt;/res-auth&gt;
      &lt;res-sharing-scope&gt;Shareable&lt;/res-sharing-scope&gt;
  &lt;/resource-ref&gt;
  
  &lt;resource-ref id="cache2"&gt;
      &lt;description&gt;cache2 description&lt;/description&gt;
      &lt;res-ref-name&gt;cache/cache2&lt;/res-ref-name&gt;
      &lt;res-type&gt;com.ibm.websphere.cache.DistributedMap&lt;/res-type&gt;
      &lt;res-auth&gt;Container&lt;/res-auth&gt;
      &lt;res-sharing-scope&gt;Shareable&lt;/res-sharing-scope&gt;
  &lt;/resource-ref&gt;
  </code></pre>
  
  <p>Thanks</p>