[jboss-jira] [JBoss JIRA] (WFLY-3028) It should be possible to initialize Filters on deployment rather than on first use

Nicolas Barrera (JIRA) issues at jboss.org
Wed Feb 26 08:14:48 EST 2014


Nicolas Barrera created WFLY-3028:
-------------------------------------

             Summary: It should be possible to initialize Filters on deployment rather than on first use
                 Key: WFLY-3028
                 URL: https://issues.jboss.org/browse/WFLY-3028
             Project: WildFly
          Issue Type: Feature Request
      Security Level: Public (Everyone can see)
          Components: EE, Web (Undertow)
    Affects Versions: 8.0.0.CR1
         Environment: Ubuntu 12.04.1 LTS 32b | JVM 1.7 | 
            Reporter: Nicolas Barrera
            Assignee: David Lloyd


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.



--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the jboss-jira mailing list