According to the web. xml configuration
Call FilterDispatcher. init (FilterConfig filterConfig)
1. Create org. apache. struts2.Dispatcher and call the init () method.
1.1. Create com. opensymphony. xwork2.config. ConfigurationManager. The attribute List <ContainerProvider> containerProviders stores all configurations.
1.2. init_DefaultProperties ();
Initialize defaproperpropertiesprovider. The method register (ContainerBuilder builder, LocatableProperties props) will load settings from org/apache/struts2/default. properties to props, and add it to containerProviders.
1.3. init_TraditionalXmlConfigurations ();
By default, based on struts-default.xml, struts-plugin.xml, struts. xml (you can modify the loading path according to init-param: config) to create three org. apache. struts2.config. strutsXmlConfigurationProvider. By default, the method register will read props from the corresponding configuration file and load it to setting. The bean will be placed in ContainerBuilder, and three containerProviders will be added to containerProviders.
1.4. init_LegacyStrutsProperties ();
Initialize LegacyPropertiesConfigurationProvider and add containerProviders
1.5. init_CustomConfigurationProviders ();
Initialize the class that implements the ContentProvider interface according to init-param: configProviders, and add containerProviders.
1.6. init_FilterInitParameters ();
Initialize a ConfigurationProvider, read the defined initParams from web. xml, and put them in props
1.7. init_AliasStandardObjects ();
Initialize BeanSelectionProvider
1.8. Container container = init_PreloadConfiguration ()
1.8.1. during initialization, configuration. reloadContainer (getContainerProviders () will be executed ());
Class: com. opensymphony. xwork2.config. impl. DefaultConfiguration
Method: reloadContainer (List <ContainerProvider> providers)
Initialize ContainerProperties props and ContainerBuilder
Traverse containerProviders and call its register (builder, props) Method
Then inject props into the builder.