5 Replies Latest reply on Jan 16, 2012 3:19 PM by Brendan Healey

    Possible to attach a filter to Resource Servlet (4.1.0.Final)?

    Brendan Healey Master

      Is it possible to attach a filter to the Resource Servlet? I tried using:

       

      @WebFilter(filterName = "MyFilter", servletNames = {"AutoRegisteredEditorResourceServlet"})

       

      with no success. What I want to do is set some http response headers, such as Last-Modified,ETag and

      Cache-Control for richfaces resources. I have resource mapping enabled and am successfully loading

      packed/compressed resources, which is brilliant, but the files themselves (i.e. packed.js) reload every

      time the page loads.

       

      All other resources in the application go through a cache filter which sets up all the headers properly.

       

      Another thing that is of interest is how to get last modified times for files that are bundled within jars in my

      application, such as richfaces*.jar & jsf-*.jar.

       

      Thanks,

      Brendan.

       

      p.s. I should point out that I'm using glassfish in a non-tomcat configuration at present. I'm going to need

             to use tomcat soon for cluster load balancing, so I do realise that Tomcat provides me with more

             configuration options.