2 Replies Latest reply on Aug 25, 2015 10:14 AM by snijdor

    global servlet filter for logging

    snijdor

      Hi experts!

       

      How do i use my own servlet filter as a 'global filter' in jboss/wildfly?

      In tomcat there is an option to include the filter in the global web.xml to use the filter for all deployed web applications, but in jboss i can't find xml tags or sample config files that include a filter (only in the specific web.xml of the application).

      So i don't want to include the filter in every web application's web.xml manually. (i don't want to touch the code or the web.xml of the applications)

       

      example:

       

      'global tomcat filter' for all deployed applications:

      /etc/tomcat7/web.xml

       

      <filter>

        <filter-name>MyFilter</filter-name>

        <filter-class>

        com.filter.MyFilter

        </filter-class>

      </filter>

      <filter-mapping>

        <filter-name>MyFilter</filter-name>

        <url-pattern>/*</url-pattern>

      </filter-mapping>

       

      ...for all applications/urls the filter gets called.

       

      I created a module for my filter, but how do i use it as a 'global' filter?!?!?!     (using jboss-eap-6.4)