title: Loading resource from a jar in a Web Application
body: <p>I read all the questions with answers but still it doesn't work for me.</p>
  
  <p>In my web application I have a jar which contains few images and xmls. These are required by the classes in that jar itself. So I modified the required lines as below:</p>
  
  <p>I changed the classes inside my jar to refer the resources(which are present inside the jar itself) by using :</p>
  
  <pre><code>Thread.currentThread().getContextClassLoader().getResource(path) // returns null
  </code></pre>
  
  <p>I had also tried before :</p>
  
  <pre><code>MyClassName.class.getResource(path) // null again
  </code></pre>
  
  <p>I read a lot about this and got to know that the later line of code will be able to pick up the resources, but unfortunately neither of it works for me...am I missing something?</p>
  
  <p>Note: Running on Tomcat7 and since I am running on Vista, I get the 'path' value as '\myFolder\images\' </p>
  
  <p>Thanks</p>