use of org.apache.myfaces.cdi.FacesApplicationArtifactHolder in project myfaces by apache.
the class AbstractContextualStorageHolder method init.
@PostConstruct
public void init() {
storageMap = new ConcurrentHashMap<>();
FacesContext facesContext = FacesContext.getCurrentInstance();
Object context = facesContext.getExternalContext().getContext();
if (context instanceof ServletContext) {
FacesApplicationArtifactHolder appBean = CDIUtils.get(beanManager, FacesApplicationArtifactHolder.class);
if (appBean.getServletContext() != null) {
appBean.setServletContext((ServletContext) context);
}
}
}
Aggregations