The order of loading is independent of their sequencing in the Web. xml file. That is, the filter is not loaded before the filter is written in front of the listener.
The true load order is: servlet, Context-param, listener, filter
< Span style= "margin:0px; padding:0px; Color:rgb (51,51,51); Font-family:verdana,arial,helvetica,sans-serif; Line-height:20.909090042114258px ">
However, for a class of configuration sections, it is related to the order in which they appear. In the case of filter, it is possible to define multiple filter in Web. XML, a configuration section related to filter is filter-mapping, and it is important to note that for filter and filter-mappin with the same filter-name In the case of the G configuration section, the filter-mapping must appear after the filter, or the corresponding filter-name is undefined when parsing to filter-mapping. When each filter is initialized when the Web container starts, it is initialized in the order in which the Filter configuration section appears, and when the request resource matches multiple filter-mapping, the filter interception resources are called dofilter () method.
< Span style= "margin:0px; padding:0px; Color:rgb (51,51,51); Font-family:verdana,arial,helvetica,sans-serif; Line-height:20.909090042114258px ">
< Span style= "margin:0px; padding:0px; Color:rgb (51,51,51); Font-family:verdana,arial,helvetica,sans-serif; Line-height:20.909090042114258px "> If you want to load spring beans in listner, be aware that Spring's related Listner in Web. XML must precede the custom Listner to load spring's listner
<listener><listener-class>org.springframework.web.util.introspectorcleanuplistener</ Listener-class></listener><listener><listener-class> Org.springframework.web.context.contextloaderlistener</listener-class></listener>
<listener><listener-class>com.wizincloud.wxmanager.tokenmanager.messagehandlelistener</ Listener-class></listener>
Listener, filter, servlet load order in Web. xml