ServletContext servletContext = this.getServletContext();
WebApplicationContext wac = null;
wac = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext);
this.jasperService = (IJasperService) wac.getBean("JasperService");//Spring配置中的UserService对应的id
来自:http://blog.youkuaiyun.com/wwwfgx1/article/details/7631665