1 16 package org.springframework.webflow.executor.jsf; 17 18 import javax.faces.context.ExternalContext; 19 import javax.faces.context.FacesContext; 20 21 31 public class FlowExecutionHolderUtils { 32 33 38 public static FlowExecutionHolder getFlowExecutionHolder(FacesContext context) { 39 return (FlowExecutionHolder)context.getExternalContext().getRequestMap().get(getFlowExecutionHolderKey()); 40 } 41 42 47 public static void setFlowExecutionHolder(FlowExecutionHolder holder, FacesContext context) { 48 context.getExternalContext().getRequestMap().put(getFlowExecutionHolderKey(), holder); 49 } 50 51 private static String getFlowExecutionHolderKey() { 52 return FlowExecutionHolder.class.getName(); 53 } 54 55 public static boolean isFlowExecutionRestored(FacesContext context) { 56 return getFlowExecutionHolder(context) != null; 57 } 58 59 public static boolean isFlowExecutionChanged(FacesContext context) { 60 return isFlowExecutionRestored(context) && getFlowExecutionHolder(context).needsSave(); 61 } 62 } | Popular Tags |