[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 16:02:47 EST 2014


     [ https://issues.jboss.org/browse/WFLY-3028?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nicolas Barrera updated WFLY-3028:
----------------------------------

    Forum Reference: https://community.jboss.org/thread/237223, http://stackoverflow.com/questions/21837506/wildfly-lazy-inits-filters-can-i-change-that  (was: http://stackoverflow.com/questions/21837506/wildfly-lazy-inits-filters-can-i-change-that)

    
> 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: Web (Undertow)
>    Affects Versions: 8.0.0.CR1
>         Environment: Ubuntu 12.04.1 LTS 32b | JVM 1.7 | 
>            Reporter: Nicolas Barrera
>            Assignee: Tomaz Cerar
>              Labels: servletfilter
>
> 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