web.xml 配置 ContextLoaderListener 或 ContextLoaderServlet;struts-config.xml 配置。
BeanFactoryPostProcessor,如 PropertyPlaceholderConfigurer(屬性佔位符)、PropertyOverrideConfigurer。FactoryBean、FactoryBeanAware 獲取 BeanFactory 實例。depends-on 強制初始化順序。BeanPostProcessor,postProcessBeforeInitialization(初始化前)、postProcessAfterInitialization(初始化後)。InitializingBean.afterPropertiesSet() → init-methodDisposableBean.destroy() → destroy-methoddepends-on 調整順序。支持設值注入與構造注入。執行順序總結(含後處理器與生命周期):
postProcessBeforeInitialization → afterPropertiesSet → init-method → postProcessAfterInitialization