How do I retrieve the FacesContext within a Filter?
I followed following article on how to retrieve the FacesContext
in a Filter
:
http://ocpsoft.org/java/jsf-java/jsf-20-extension-development-accessing-facescontext-in-a-filter/
But the problem is that it is not working with Flash scope. Following NPE is thrown:
java.lang.NullPointerException
at com.sun.faces.context.flash.ELFlash.loggingGetPhaseMapForWriting(ELFlash.java:751)
at com.sun.faces.context.flash.ELFlash.getPhaseMapForWriting(ELFlash.java:785)
at com.sun.faces.context.flash.ELFlash.put(ELFlash.java:392)
at com.sun.faces.context.flash.ELFlash.put(ELFlash.java:112)
I want to add redirection in my filter and use flash scope to save some data and also Messages, which is not working.
HttpSession.getAttribute()
the current FacesContext is still null. – Weak