Filter

Enable Sniffy filter in web.xml

<filter>
    <filter-name>sniffer</filter-name>
    <filter-class>io.sniffy.servlet.SniffyFilter</filter-class>
    <async-supported>true</async-supported>
    <init-param>
        <param-name>enabled</param-name> (1)
        <param-value>true</param-value> <!-- default: true -->
    </init-param>
    <init-param>
        <param-name>exclude-pattern</param-name> (2)
        <param-value>^/vets.html$</param-value> <!-- optional -->
    </init-param>
    <init-param>
        <param-name>inject-html</param-name> (3)
        <param-value>true</param-value> <!-- default: true -->
    </init-param>
    <init-param>
        <param-name>inject-html-exclude-pattern</param-name> (4)
        <param-value>^/peds.html$</param-value> <!-- optional -->
    </init-param>
</filter>
<filter-mapping>
    <filter-name>sniffer</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>
  1. Allows disabling the Sniffy filter in web.xml

  2. Allows excluding some of the request URL’s from Sniffer filter

  3. Enables injection of Sniffy toolbar to HTML. If disabled the html remains untouched. You still can get the number of executed queries from Sniffy-Sql-Queries HTTP header.

  4. Allows excluding of Sniffy toolbar injection to some of the request URL’s

Apart from obvious false and true values, you can set inject-html and 'enabled' parameters to a system value. It will act as described in table below:

Table 1. Sniffy Filter Configuration
-Dio.sniffy.filterEnabled or IO_SNIFFY_FILTER_ENABLED enabled filter init param Effective value

null

absent

true

true

absent

true

false

absent

false

null

false

false

true

false

false

false

false

false

null

true

true

true

true

true

false

true

true

null

system

false

true

system

true

false

system

false

Similar rules are applied to inject-html filter parameter