title: web.xml - Java Servlet Filters and WebSphere - URL Pattern issues
body: <p>So we are running a web application that has been tested on Tomcat, Glassfish, WebLogic and WebSphere. All run correctly except WebSphere. The issue is that filters are not processed for files under a certain directory.</p>
  
  <p>For example I have a filter that checks the user's lanuage from browser cookies and another that get the user's username, in the web.xml there are configured like so:</p>
  
  <pre><code>&lt;!-- ****************************** --&gt;
  &lt;!-- * Security context filtering * --&gt;
  &lt;!-- ****************************** --&gt;
  
  &lt;filter&gt;
      &lt;filter-name&gt;SetSecurityContextFilter&lt;/filter-name&gt;
      &lt;filter-class&gt;
          com.test.security.SecurityContextServletFilter
      &lt;/filter-class&gt;
  &lt;/filter&gt;
  
  &lt;!-- ****************************** --&gt;
  &lt;!-- ** Locale context filtering ** --&gt;
  &lt;!-- ****************************** --&gt;
  
  &lt;filter&gt;
      &lt;filter-name&gt;SetLocaleFilter&lt;/filter-name&gt;
      &lt;filter-class&gt;
          com.test.locale.LocaleServletFilter
      &lt;/filter-class&gt;
  &lt;/filter&gt;
  
  &lt;filter-mapping&gt;
      &lt;filter-name&gt;SetSecurityContextFilter&lt;/filter-name&gt;
      &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
  &lt;/filter-mapping&gt;
  
  &lt;filter-mapping&gt;
      &lt;filter-name&gt;SetLocaleFilter&lt;/filter-name&gt;
      &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
  &lt;/filter-mapping&gt; 
  </code></pre>
  
  <p>Both filters set a static threadlocal variable which can be accessed from a static getter, but when the same file 'test.jsp' invokes the getters, under '<em>contextroot</em>/js' they return the default values (as if unset) while under '<em>contextroot</em>/pages' they are correct.</p>
  
  <p>Any ideas?</p>
  
  <p>Thanks in advance.</p>