在Servlet中获取spring容器WebApplicationContext WebApplicationContext springContext = WebApplicationContextUtils.getRequiredWebApplicationContext(getServletContext());