package spring;

import javax.servlet.http.HttpServlet;

import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

public class Context {

	private WebApplicationContext context = null;

	public Context(HttpServlet servlet) {
		super();
		context = WebApplicationContextUtils.getRequiredWebApplicationContext(servlet.getServletContext());
	}

	public Object getBean(String nomeBean) {
		return context.getBean(nomeBean);
	}

}
