flash-scope

How do I retrieve the FacesContext within a Filter

我的未来我决定 提交于 2019-11-26 14:44:58
问题 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

Exception about flash in Mojarra JSF

梦想的初衷 提交于 2019-11-26 14:08:50
问题 I upgraded to Mojarra JSF 2.2.1 (from 2.1.22) and since then for each of my requests I'm having an exception in console: GRAVE: JSF1094: Could not decode flash data from incoming cookie value /?. Processing will continue, but the flash is unavailable for this request. com.sun.faces.lifecycle.InvokeApplicationPhase execute Request finishes succesfully when I'm not using flash scope on it. However, as I'm using this scope for FacesMessages , if I put a message here, I have a

Understand Flash Scope in JSF2

爷,独闯天下 提交于 2019-11-26 00:48:31
问题 From what I understand , objects placed inside the Flash scope in a faces request lifecycle will be available for the next faces request lifecycle and then clear. Suppose I have two pages: page01.xhtml : <h:form> <h:commandButton action=\"#{page01Bean.action}\" /> </h:form> Page01Bean : @ManagedBean @RequestScoped public class Page01Bean { public void action(){ FacesContext.getCurrentInstance().getExternalContext().getFlash().put(\"fooKey\", \"fooValue\"); } } page02.xhtml : <h:outputText