
方式1:
ApplicationContext ac = (ApplicationContext) invocation.getInvocationContext().getApplication().get(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE); 方式2:
ServletContext sc = ServletActionContext.getServletContext();
ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(sc);