public class WebContextBeanFinder {
public static Object getBean(String beanId) {
ServletContext servletContext = ServletActionContext.getServletContext();
WebApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(servletContext);
return context.getBean(beanId);
}
}