title: Locating Javascript and other resources in modular JSF 2.2.x application
body: <p>I have a modular JSF application. Facelets are stored in the module in META-INF/resources. I added a custom FaceletsResourceResolver (as demonstrated in this post <a href="https://stackoverflow.com/questions/6199458/how-to-create-a-modular-jsf-2-0-application/6201044#6201044">How to create a modular JSF 2.0 application?</a>) and all of this works well with .xhtml - Files. Now I am trying to add other resources in the same fashion and it's not working. </p>
  
  <p>Let's say I have this structure in the module:</p>
  
  <pre><code>/META-INF/resources
  /META-INF/resources/foo
  /META-INF/resources/foo/bar.xhtml
  /META-INF/resources/foo/bar.js
  </code></pre>
  
  <p>Now the application resolves /foo/bar.xhtml just fine. But attempts to fetch /foo/bar.js simply fail with 404. I tried using </p>
  
  <pre><code>&lt;h:outputScript library="modulename" name="foo/bar.js" /&gt;
  </code></pre>
  
  <p>as well as direct reference</p>
  
  <pre><code>&lt;script language="text/javascript" src="/context/foo/bar.js"/&gt;
  </code></pre>
  
  <p>both to no avail. I feel I am missing something. Can someone help me?</p>
  
  <p>PS: using Apache Tomcat 6 and Eclipse-Juno for development.</p>