<%WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(this
.getServletContext());
System.out.println("===========初始化成功=========");
worksService = (SomeServiceImpl) wac.getBean("someService");%>
spring部分代码:
String attrName=WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE;//值为:
"org.springframework.web.context.WebApplicationContext.ROOT"
Object attr = sc.getAttribute(attrName);
return (WebApplicationContext)attr ;
.getServletContext());
System.out.println("===========初始化成功=========");
worksService = (SomeServiceImpl) wac.getBean("someService");%>
spring部分代码:
String attrName=WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE;//值为:
"org.springframework.web.context.WebApplicationContext.ROOT"
Object attr = sc.getAttribute(attrName);
return (WebApplicationContext)attr ;