title: Spring MVC : read file from src/main/resources
body: <p>I have a maven Spring project, there is <code>xml</code> file inside <code>src/main/resources/xyz.xml</code>. How can I read it inside spring MVC controller.</p>
  
  <p>I am using </p>
  
  <pre><code>InputStream is = getClass().getResourceAsStream("classpath:xyz.xml");
  </code></pre>
  
  <p>but <code>is</code> is <code>null</code>.</p>