title: How to create a JSF Filter/url-pattern to protect javascripts
body: <p>I've written a Java web filter to handle my JSF application's security. I've the filter's mapping like this:</p>
  
  <pre><code>&lt;filter-mapping&gt;
      &lt;filter-name&gt;authFilter&lt;/filter-name&gt;
      &lt;url-pattern&gt;/secure/*&lt;/url-pattern&gt;
      &lt;url-pattern&gt;/login.jsf&lt;/url-pattern&gt;
      &lt;url-pattern&gt;/*.js.jsf&lt;/url-pattern&gt;    &lt;--- invalid pattern
  &lt;/filter-mapping&gt;
  </code></pre>
  
  <p>and now i want to create a url-pattern to filter all javascript files. I'm using Primefaces, so the .js files are retrived in URLs like this:</p>
  
  <pre><code>http://localhost:8080/MyProject/javax.faces.resource/MyJavascriptFile.js.jsf?ln=MyLibrary
  </code></pre>
  
  <p>I cant filter the whole <code>javax.faces.resouces</code> because it also holds the CSS files. Is there a way to create a URL pattern to match only javascripts?</p>