网上找了不少方法试,只有下面这种方式能在新开的线程中访问到beanspa
WebApplicationContext context = ContextLoader.getCurrentWebApplicationContext();
ZlAreaAliasService zlAreaAliasService=(ZlAreaAliasService) context.getBean("zlAreaAliasService");线程
获取当前的WebAppliactionContext(),再获取context中的bean;get