I want to use "global" HTTP filters.
Therefor, I edited deploy/jboss-web.deployer/conf/web.xml
and added:
<filter>
<filter-name>StatisticsFilterHitCount</filter-name>
<filter-class>myapp.StatisticsFilterHitCount</filter-class>
</filter>
<filter-mapping>
<filter-name>StatisticsFilterHitCount</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
Now, when I start the server, not a single artifact can be deployed. A huge exception is logged on each deployment attempt. Sorry, can't paste it here. I suppose, at the time of deployment, the filter class is not present yet.
So, where (and how) do I have to deploy such filter globally?
Currently, it's in applications/5apps
, the packaging is .war
.
Look at
Jboss/server/default/deploy/jboss-web.deployer/conf/web.xml
. There is even an example of global CommonHeadersFilter.But you would have to place the code in some jar under
JBoss/server/default/lib
. JBoss can't peek up the code in the war at web container's initialization process.