/** * The request is about to come into scope of the web application. * * @param event the notification event */ public void requestInitialized(ServletRequestEvent event) { FacesContext facesContext = FacesContext.getCurrentInstance(); if (facesContext instanceof InitFacesContext) { InitFacesContext initFacesContext = (InitFacesContext) facesContext; initFacesContext.releaseCurrentInstance(); // Bug 20458755 Clean up the entry for the InitContext corresponding // to this ServletContext initFacesContext.removeServletContextEntryForInitContext(); } ApplicationAssociate.setCurrentInstance(getAssociate()); }
/** * The request is about to come into scope of the web application. * * @param event the notification event */ public void requestInitialized(ServletRequestEvent event) { FacesContext facesContext = FacesContext.getCurrentInstance(); if (facesContext instanceof InitFacesContext) { InitFacesContext initFacesContext = (InitFacesContext) facesContext; initFacesContext.releaseCurrentInstance(); // Bug 20458755 Clean up the entry for the InitContext corresponding // to this ServletContext initFacesContext.removeServletContextEntryForInitContext(); } ApplicationAssociate.setCurrentInstance(getAssociate()); }
/** * The request is about to come into scope of the web application. * * @param event the notification event */ public void requestInitialized(ServletRequestEvent event) { FacesContext facesContext = FacesContext.getCurrentInstance(); if (facesContext instanceof InitFacesContext) { InitFacesContext initFacesContext = (InitFacesContext) facesContext; initFacesContext.releaseCurrentInstance(); // Bug 20458755 Clean up the entry for the InitContext corresponding // to this ServletContext initFacesContext.removeServletContextEntryForInitContext(); } ApplicationAssociate.setCurrentInstance(getAssociate()); }
/** * The request is about to come into scope of the web application. * * @param event the notification event */ public void requestInitialized(ServletRequestEvent event) { FacesContext facesContext = FacesContext.getCurrentInstance(); if (facesContext instanceof InitFacesContext) { InitFacesContext initFacesContext = (InitFacesContext) facesContext; initFacesContext.releaseCurrentInstance(); // Bug 20458755 Clean up the entry for the InitContext corresponding // to this ServletContext initFacesContext.removeServletContextEntryForInitContext(); } ApplicationAssociate.setCurrentInstance(getAssociate()); }
@Override public void onStartup(Set<Class<?>> classes, ServletContext servletContext) throws ServletException { Set<Class<?>> annotatedClasses = new HashSet<Class<?>>(); if (classes != null) { annotatedClasses.addAll(classes); } servletContext.setAttribute(ANNOTATED_CLASSES, annotatedClasses); boolean appHasSomeJsfContent = appMayHaveSomeJsfContent(classes, servletContext); boolean appHasFacesServlet = getExistingFacesServletRegistration(servletContext) != null; if (appHasSomeJsfContent || appHasFacesServlet) { InitFacesContext initFacesContext = new InitFacesContext(servletContext); try { if (appHasSomeJsfContent) { // Only look at mapping concerns if there is JSF content handleMappingConcerns(servletContext); } // Other concerns also handled if there is an existing Faces Servlet mapping handleWebSocketConcerns(servletContext); } finally { // Bug 20458755: The InitFacesContext was not being cleaned up, resulting in // a partially constructed FacesContext being made available // to other code that re-uses this Thread at init time. initFacesContext.releaseCurrentInstance(); initFacesContext.release(); } } }
@Override public void onStartup(Set<Class<?>> classes, ServletContext servletContext) throws ServletException { Set<Class<?>> annotatedClasses = new HashSet<Class<?>>(); if (classes != null) { annotatedClasses.addAll(classes); } servletContext.setAttribute(ANNOTATED_CLASSES, annotatedClasses); boolean appHasSomeJsfContent = appMayHaveSomeJsfContent(classes, servletContext); boolean appHasFacesServlet = getExistingFacesServletRegistration(servletContext) != null; if (appHasSomeJsfContent || appHasFacesServlet) { InitFacesContext initFacesContext = new InitFacesContext(servletContext); try { if (appHasSomeJsfContent) { // Only look at mapping concerns if there is JSF content handleMappingConcerns(servletContext); } // Other concerns also handled if there is an existing Faces Servlet mapping handleWebSocketConcerns(servletContext); } finally { // Bug 20458755: The InitFacesContext was not being cleaned up, resulting in // a partially constructed FacesContext being made available // to other code that re-uses this Thread at init time. initFacesContext.releaseCurrentInstance(); initFacesContext.release(); } } }
initFacesContext.releaseCurrentInstance(); initFacesContext.release();
@Override public void onStartup(Set<Class<?>> classes, ServletContext servletContext) throws ServletException { Set<Class<?>> annotatedClasses = new HashSet<Class<?>>(); if (classes != null) { annotatedClasses.addAll(classes); } servletContext.setAttribute(ANNOTATED_CLASSES, annotatedClasses); boolean appHasSomeJsfContent = appMayHaveSomeJsfContent(classes, servletContext); boolean appHasFacesServlet = getExistingFacesServletRegistration(servletContext) != null; if (appHasSomeJsfContent || appHasFacesServlet) { InitFacesContext initFacesContext = new InitFacesContext(servletContext); try { if (appHasSomeJsfContent) { // Only look at mapping concerns if there is JSF content handleMappingConcerns(servletContext); } // Other concerns also handled if there is an existing Faces Servlet mapping servletContext.addListener(ConfigureListener.class); handleWebSocketConcerns(servletContext); } finally { // Bug 20458755: The InitFacesContext was not being cleaned up, resulting in // a partially constructed FacesContext being made available // to other code that re-uses this Thread at init time. initFacesContext.releaseCurrentInstance(); initFacesContext.release(); } } }
initContext.releaseCurrentInstance();
initContext.releaseCurrentInstance();
initContext.releaseCurrentInstance();