Details
-
Feature Request
-
Resolution: Done
-
Major
-
8.0.0.CR1
Description
As I see it Wildfly “Lazy-Inits” Filters, and that's causing some problems in my project, here is my case:
It happens that I have a filter chain declared in web.xml
FilterA -> FilterB
so that when a new request arrives FilterA is executed first and FilterB second.
My problem is that FilterA needs FilterB to be initialized before it's filter method is executed.
When using other web containers (tomcat/jetty) I had no problem with this scenario because filters' init method is called on server startup.
With wildfly the init method of a Filter is not called until it receives the first request so the methods would be called in this order:
FilterA.init, FilterA.filter, FilterB.init, FilterB.filter
and FilterA.filter will fail because FilterB.init wasn't called earlier.
Maybe it's ok to have certain mode where Filters are initialized lazily but I 'd like to have some configuration option that let me initialize filters on startup.
I 've asked on stackoverflow about this problem and after a while only one person showed up and recommended me to raise a JIRA, so I assumed this was not possible in Wildfly 8.