I am wondering, how can I set in the web.xml a Filter that is called on every request?
just create a filter, and map it to /*
e.g.
<filter>
<filter-name>MyFilter</filter-name>
<filter-class>com.mycompany.MyFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>MyFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
Add a filter mapping with '*' wildcard.
<filter-mapping>
<filter-name>TestFilter</filter-name>
<url-pattern>*</url-pattern>
</filter-mapping>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With