1
我写的FacesContext Logique定制的春季范围的基极电流的要求,获取自定义春季范围
public class DynamicScope implements Scope{
@Override
public Object get(String name, ObjectFactory<?> objectFactory) {
AbsErpFolder erpFolder = null;
if (FacesContext.getCurrentInstance()!=null)
erpFolder = (AbsErpFolder)FacesUtils.getExternalContext().
getRequestMap().get(ErpFolderKey);
............
}
现在我需要使用
WebApplicationContext wsc = WebApplicationContextUtils.getWebApplicationContext(config.getServletContext());
IGenericService erpFileService = (IGenericService) wsc.getBean("erpFileService");
的问题是期间实例化在FileServlet过滤豆执行我的ServletFile当前的FacesContext为null(动态范围无法工作),那么如何获取当前请求呢?