spring 中ContextLoaderListener监听器的作用就是启动Web容器时,自动装配ApplicationContext的配置信息。你可以自己写个Listener继承这个ContextLoaderListener或者ServletContextListener 以及ApplicationListener,然后实现其中的方法就可以。