ServletContext ctx = getServletContext();
//Grab a reference to the application context
ApplicationContext appCtx = (ApplicationContext) ctx.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);
//Get the bean holding the parameter
ISessionManagerGateway manager = (ISessionManagerGateway) appCtx.getBean("sessionManagerGateway");
if (manager != null) {
System.out.println("****Got the SessionManager context: *****");
}
return manager;
}