代码如下
private UploadHistoryTempManager uploadManager;
@Override
public void init() throws ServletException {
super.init();
ServletContext servletContext = this.getServletContext();
WebApplicationContext wac = null;
wac = WebApplicationContextUtils
.getRequiredWebApplicationContext(servletContext);
uploadManager = (UploadHistoryTempManager) wac.getBean("uploadHistoryTempManager");
}