<%@ page import="org.springframework.web.context.support.webapplicationcontextutils"%>
<%@ page import="org.springframework.context.applicationcontext"%>
servletcontext sc = this.getservletconfig().getservletcontext();
applicationcontext ac2 = webapplicationcontextutils.getwebapplicationcontext(sc);
要获取的对象 serv = (要获取的对象) ac2.getbean("spring配置文件中的id");
【说明】:本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!