public void init(ServletConfig servletConfig) throws ServletException {
ServletContext servletContext = servletConfig.getServletContext();
WebApplicationContext webApplicationContext = WebApplicationContextUtils.getWebApplicationContext(servletContext);
YOUR_BEAN = (YOUR_BEAN) webApplicationContext.getBean("your_bean_name");
}