{
if (FLASH.equals(strProperty))
{
//Access to flash object
elContext.setPropertyResolved(true);
Flash flash = externalContext.getFlash();
//This is just to make sure after this point
//we are not in "keep" promotion.
setDoKeepPromotion(false, facesContext);
// Note that after this object is returned, Flash.get() and Flash.put()
// methods are called from javax.el.MapELResolver, since
// Flash is instance of Map.
return flash;
}
}
else if (base instanceof Flash)
{
Flash flash = (Flash) base;
if (KEEP.equals(strProperty))
{
setDoKeepPromotion(true, facesContext);
// Since we returned a Flash instance getValue will
// be called again but this time the property name
// to be resolved will be called, so we can do keep
// promotion.
elContext.setPropertyResolved(true);
return base;
}
else if (NOW.equals(strProperty))
{
//Prevent invalid syntax #{flash.keep.now.someKey}
if (!isDoKeepPromotion(facesContext))
{
// According to the javadoc of Flash.putNow() and
// Flash.keep(), this is an alias to requestMap, used
// as a "buffer" to promote vars to flash scope using
// "keep" method
elContext.setPropertyResolved(true);
return externalContext.getRequestMap();
}
}
else if (isDoKeepPromotion(facesContext))
{
//Resolve property calling get or keep
elContext.setPropertyResolved(true);
//promote it to flash scope
flash.keep(strProperty);
//Obtain the value on requestMap if any
Object value = externalContext.getRequestMap().get(strProperty);
return value;
}
else
{
//Just get the value
elContext.setPropertyResolved(true);
return flash.get(strProperty);
}
}
return null;
}