本文整理了Java中javax.faces.context.Flash.get()
方法的一些代码示例,展示了Flash.get()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Flash.get()
方法的具体详情如下:
包路径:javax.faces.context.Flash
类名称:Flash
方法名:get
暂无
代码示例来源:origin: com.sun.faces/jsf-api
/**
* <p class="changed_added_2_2">The default behavior of this method
* is to call {@link Flash#get(Object)} on the wrapped {@link Flash}
* object.</p>
*
* @since 2.2
*/
@Override
public Object get(Object key) {
return getWrapped().get(key);
}
代码示例来源:origin: omnifaces/omnifaces
/**
* @see Faces#getFlashAttribute(String)
*/
@SuppressWarnings("unchecked")
public static <T> T getFlashAttribute(FacesContext context, String name) {
return (T) getFlash(context).get(name);
}
代码示例来源:origin: org.omnifaces/omnifaces
/**
* @see Faces#getFlashAttribute(String)
*/
@SuppressWarnings("unchecked")
public static <T> T getFlashAttribute(FacesContext context, String name) {
return (T) getFlash(context).get(name);
}
代码示例来源:origin: org.apache.myfaces.core/myfaces-api
public Object get(Object key)
{
return getWrapped().get(key);
}
代码示例来源:origin: javax.faces/javax.faces-api
/**
* <p class="changed_added_2_2">The default behavior of this method
* is to call {@link Flash#get(Object)} on the wrapped {@link Flash}
* object.</p>
*
* @since 2.2
*/
@Override
public Object get(Object key) {
return getWrapped().get(key);
}
代码示例来源:origin: org.glassfish/javax.faces
/**
* <p class="changed_added_2_2">The default behavior of this method
* is to call {@link Flash#get(Object)} on the wrapped {@link Flash}
* object.</p>
*
* @since 2.2
*/
@Override
public Object get(Object key) {
return getWrapped().get(key);
}
代码示例来源:origin: javax/javaee-web-api
/**
* <p class="changed_added_2_2">The default behavior of this method
* is to call {@link Flash#get(Object)} on the wrapped {@link Flash}
* object.</p>
*
* @since 2.2
*/
@Override
public Object get(Object key) {
return getWrapped().get(key);
}
代码示例来源:origin: eclipse-ee4j/mojarra
/**
* <p class="changed_added_2_2">The default behavior of this method
* is to call {@link Flash#get(Object)} on the wrapped {@link Flash}
* object.</p>
*
* @since 2.2
*/
@Override
public Object get(Object key) {
return getWrapped().get(key);
}
代码示例来源:origin: org.glassfish/jakarta.faces
/**
* <p class="changed_added_2_2">The default behavior of this method
* is to call {@link Flash#get(Object)} on the wrapped {@link Flash}
* object.</p>
*
* @since 2.2
*/
@Override
public Object get(Object key) {
return getWrapped().get(key);
}
代码示例来源:origin: eclipse-ee4j/mojarra
/**
* <p class="changed_added_2_2">The default behavior of this method
* is to call {@link Flash#get(Object)} on the wrapped {@link Flash}
* object.</p>
*
* @since 2.2
*/
@Override
public Object get(Object key) {
return getWrapped().get(key);
}
代码示例来源:origin: jboss/jboss-javaee-specs
/**
* <p class="changed_added_2_2">The default behavior of this method
* is to call {@link Flash#get(Object)} on the wrapped {@link Flash}
* object.</p>
*
* @since 2.2
*/
@Override
public Object get(Object key) {
return getWrapped().get(key);
}
代码示例来源:origin: br.com.jarch/jarch-jsf
public static Object getAttributeFlash(String nameAttribute) {
return getFlash().get(nameAttribute);
}
代码示例来源:origin: org.apache.myfaces.core/myfaces-impl
@Override
public Class<?> getType(ELContext context, Object base, Object property)
throws NullPointerException, PropertyNotFoundException, ELException
{
if (property == null)
{
throw new PropertyNotFoundException();
}
if (!(property instanceof String))
{
return null;
}
String strProperty = property.toString();
if (FLASH.equals(strProperty))
{
context.setPropertyResolved(true);
}
else if (base instanceof Flash)
{
context.setPropertyResolved(true);
Object obj = ((Flash) base).get(property);
return (obj != null) ? obj.getClass() : null;
}
return null;
}
代码示例来源:origin: org.apache.myfaces.core/myfaces-shaded-impl
@Override
public Class<?> getType(ELContext context, Object base, Object property)
throws NullPointerException, PropertyNotFoundException, ELException
{
if (property == null)
throw new PropertyNotFoundException();
if (!(property instanceof String))
return null;
String strProperty = castAndIntern(property);
if (FLASH.equals(strProperty))
{
context.setPropertyResolved(true);
}
else if (base instanceof Flash) {
context.setPropertyResolved(true);
Object obj = ((Flash) base).get(property);
return (obj != null) ? obj.getClass() : null;
}
return null;
}
代码示例来源:origin: org.apache.myfaces.core.internal/myfaces-shaded-impl
@Override
public Class<?> getType(ELContext context, Object base, Object property)
throws NullPointerException, PropertyNotFoundException, ELException
{
if (property == null)
throw new PropertyNotFoundException();
if (!(property instanceof String))
return null;
String strProperty = castAndIntern(property);
if (FLASH.equals(strProperty))
{
context.setPropertyResolved(true);
}
else if (base instanceof Flash) {
context.setPropertyResolved(true);
Object obj = ((Flash) base).get(property);
return (obj != null) ? obj.getClass() : null;
}
return null;
}
代码示例来源:origin: liferay/liferay-faces
/**
* <p>This method is called before the {@link PhaseId#RENDER_RESPONSE} phase of the JSF lifecycle is executed. The
* purpose of this timing is to pick up where the {@link #beforeInvokeApplicationPhase(PhaseEvent)} method left off.
* It might be the case that a navigation-rule has fired and a NEW JSF view has been loaded up after the {@link
* PhaseId#APPLY_REQUEST_VALUES} phase (in the case of immediate="true") or the {@link PhaseId#INVOKE_APPLICATION}
* phase (in the case of immediate="false") has completed. If this is the case, then the list of head resourceIds in
* the {@link HeadManagedBean} needs to be repopulated from the list found in the Flash scope.</p>
*/
protected void beforeAjaxifiedRenderResponsePhase(PhaseEvent phaseEvent) {
FacesContext facesContext = phaseEvent.getFacesContext();
Flash flash = facesContext.getExternalContext().getFlash();
String viewId = facesContext.getViewRoot().getViewId();
@SuppressWarnings("unchecked")
Set<String> headResourceIdsFromFlash = (Set<String>) flash.get(HEAD_RESOURCE_IDS);
if (headResourceIdsFromFlash != null) {
HeadManagedBean headManagedBean = HeadManagedBean.getInstance(facesContext);
Set<String> managedBeanResourceIds = headManagedBean.getHeadResourceIds();
for (String resourceIdFromFlash : headResourceIdsFromFlash) {
if (!managedBeanResourceIds.contains(resourceIdFromFlash)) {
managedBeanResourceIds.add(resourceIdFromFlash);
logger.debug(
"Added resourceId=[{0}] from the Flash scope to the list of resourceIds in the HeadManagedBean for viewId=[{1}]",
resourceIdFromFlash, viewId);
}
}
}
}
代码示例来源:origin: mysticfall/pivot4j
@PostConstruct
protected void initialize() {
FacesContext context = FacesContext.getCurrentInstance();
ExternalContext externalContext = context.getExternalContext();
Flash flash = externalContext.getFlash();
Map<String, String> parameters = externalContext
.getRequestParameterMap();
this.viewId = parameters.get(settings.getViewParameterName());
if (viewId == null) {
this.viewId = (String) flash.get("viewId");
}
ViewState state = null;
if (viewId != null) {
state = viewStateHolder.getState(viewId);
}
if (state == null) {
ProjectStage stage = context.getApplication().getProjectStage();
if (stage == ProjectStage.UnitTest) {
state = viewStateHolder.createNewState();
viewStateHolder.registerState(state);
this.viewId = state.getId();
} else {
throw new FacesException("No view state data is available : "
+ viewId);
}
}
if (log.isInfoEnabled()) {
log.info("Using an existing view state : {}", viewId);
}
}
代码示例来源:origin: com.liferay.faces/liferay-faces-bridge-impl
/**
* <p>This method is called before the {@link PhaseId#RENDER_RESPONSE} phase of the JSF lifecycle is executed. The
* purpose of this timing is to pick up where the {@link #beforeInvokeApplicationPhase(PhaseEvent)} method left off.
* It might be the case that a navigation-rule has fired and a NEW JSF view has been loaded up after the {@link
* PhaseId#APPLY_REQUEST_VALUES} phase (in the case of immediate="true") or the {@link PhaseId#INVOKE_APPLICATION}
* phase (in the case of immediate="false") has completed. If this is the case, then the list of head resourceIds in
* the {@link HeadManagedBean} needs to be repopulated from the list found in the Flash scope.</p>
*/
protected void beforeAjaxifiedRenderResponsePhase(PhaseEvent phaseEvent) {
FacesContext facesContext = phaseEvent.getFacesContext();
Flash flash = facesContext.getExternalContext().getFlash();
String viewId = facesContext.getViewRoot().getViewId();
@SuppressWarnings("unchecked")
Set<String> headResourceIdsFromFlash = (Set<String>) flash.get(HEAD_RESOURCE_IDS);
if (headResourceIdsFromFlash != null) {
HeadManagedBean headManagedBean = HeadManagedBean.getInstance(facesContext);
Set<String> managedBeanResourceIds = headManagedBean.getHeadResourceIds();
for (String resourceIdFromFlash : headResourceIdsFromFlash) {
if (!managedBeanResourceIds.contains(resourceIdFromFlash)) {
managedBeanResourceIds.add(resourceIdFromFlash);
logger.debug(
"Added resourceId=[{0}] from the Flash scope to the list of resourceIds in the HeadManagedBean for viewId=[{1}]",
resourceIdFromFlash, viewId);
}
}
}
}
代码示例来源:origin: org.apache.myfaces.core.internal/myfaces-shaded-impl
Boolean.TRUE.equals(context.getExternalContext().getRequestMap().get("oam.Flash.REDIRECT.PREVIOUSREQUEST")))
key = (SerializedViewKey) context.getExternalContext().getFlash().get(RESTORED_VIEW_KEY_REQUEST_ATTR);
代码示例来源:origin: com.liferay.faces/liferay-faces-bridge-impl
Set<String> headResourceIdsFromFlash = (Set<String>) flash.get(HEAD_RESOURCE_IDS);
内容来源于网络,如有侵权,请联系作者删除!