當前位置: 首頁>>代碼示例>>Java>>正文


Java PhaseEvent.getPhaseId方法代碼示例

本文整理匯總了Java中javax.faces.event.PhaseEvent.getPhaseId方法的典型用法代碼示例。如果您正苦於以下問題:Java PhaseEvent.getPhaseId方法的具體用法?Java PhaseEvent.getPhaseId怎麽用?Java PhaseEvent.getPhaseId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.faces.event.PhaseEvent的用法示例。


在下文中一共展示了PhaseEvent.getPhaseId方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: reportPhase

import javax.faces.event.PhaseEvent; //導入方法依賴的package包/類
private void reportPhase (PhaseEvent event, boolean after) {
    HttpSession session = (HttpSession) event.getFacesContext().getExternalContext().getSession(false);
    if (session != null) {
        if (after && event.getPhaseId() == PhaseId.RENDER_RESPONSE) {
            session.removeAttribute(PHASE);
        } else {
            if (!after) session.setAttribute(PHASE, event.getPhaseId());
        }

    }

    if (!after && event.getPhaseId() == PhaseId.RENDER_RESPONSE) {
        //DumpView(event.getFacesContext());
    }
    //System.out.println ("**********************"+(after ? "AFTER " : "BEFORE ")+event.getPhaseId()+" session="+session);        System.out.flush();
}
 
開發者ID:navisidhu,項目名稱:libreacs,代碼行數:17,代碼來源:PhaseListener.java

示例2: afterPhase

import javax.faces.event.PhaseEvent; //導入方法依賴的package包/類
public void afterPhase(PhaseEvent event) {
	PhaseId curId = event.getPhaseId();
	if (PhaseId.APPLY_REQUEST_VALUES.equals(curId)) {
		doAfterApplyRequest(event);
	} else if (PhaseId.INVOKE_APPLICATION.equals(curId)) {
		doAfterInvokeApplication(event);
	} else if (PhaseId.PROCESS_VALIDATIONS.equals(curId)) {
		doAfterProcessValidations(event);
	} else if (PhaseId.RENDER_RESPONSE.equals(curId)) {
		doAfterRenderResponse(event);
	} else if (PhaseId.RESTORE_VIEW.equals(curId)) {
		doAfterRestoreView(event);
	} else if (PhaseId.UPDATE_MODEL_VALUES.equals(curId)) {
		doAfterUpdateModel(event);
	}
	doAfterEveryPhase(event);
}
 
開發者ID:OpenNTF,項目名稱:BuildAndTestPattern4Xpages,代碼行數:18,代碼來源:PhaseListener.java

示例3: beforePhase

import javax.faces.event.PhaseEvent; //導入方法依賴的package包/類
public void beforePhase(PhaseEvent event) {
	PhaseId curId = event.getPhaseId();
	if (PhaseId.APPLY_REQUEST_VALUES.equals(curId)) {
		doBeforeApplyRequest(event);
	} else if (PhaseId.INVOKE_APPLICATION.equals(curId)) {
		doBeforeInvokeApplication(event);
	} else if (PhaseId.PROCESS_VALIDATIONS.equals(curId)) {
		doBeforeProcessValidations(event);
	} else if (PhaseId.RENDER_RESPONSE.equals(curId)) {
		doBeforeRenderResponse(event);
	} else if (PhaseId.RESTORE_VIEW.equals(curId)) {
		doBeforeRestoreView(event);
	} else if (PhaseId.UPDATE_MODEL_VALUES.equals(curId)) {
		doBeforeUpdateModel(event);
	}
	doBeforeEveryPhase(event);
}
 
開發者ID:OpenNTF,項目名稱:BuildAndTestPattern4Xpages,代碼行數:18,代碼來源:PhaseListener.java

示例4: afterPhase

import javax.faces.event.PhaseEvent; //導入方法依賴的package包/類
public void afterPhase(PhaseEvent arg0) {
	PhaseId curId = arg0.getPhaseId();
	if (PhaseId.APPLY_REQUEST_VALUES.equals(curId)) {
		doAfterApplyRequest(arg0);
	} else if (PhaseId.INVOKE_APPLICATION.equals(curId)) {
		doAfterInvokeApplication(arg0);
	} else if (PhaseId.PROCESS_VALIDATIONS.equals(curId)) {
		doAfterProcessValidations(arg0);
	} else if (PhaseId.RENDER_RESPONSE.equals(curId)) {
		doAfterRenderResponse(arg0);
	} else if (PhaseId.RESTORE_VIEW.equals(curId)) {
		doAfterRestoreView(arg0);
	} else if (PhaseId.UPDATE_MODEL_VALUES.equals(curId)) {
		doAfterUpdateModel(arg0);
	}
	doAfterEveryPhase(arg0);
}
 
開發者ID:OpenNTF,項目名稱:xsp.extlib,代碼行數:18,代碼來源:PhaseListener.java

示例5: beforePhase

import javax.faces.event.PhaseEvent; //導入方法依賴的package包/類
public void beforePhase(PhaseEvent arg0) {
	PhaseId curId = arg0.getPhaseId();
	if (PhaseId.APPLY_REQUEST_VALUES.equals(curId)) {
		doBeforeApplyRequest(arg0);
	} else if (PhaseId.INVOKE_APPLICATION.equals(curId)) {
		doBeforeInvokeApplication(arg0);
	} else if (PhaseId.PROCESS_VALIDATIONS.equals(curId)) {
		doBeforeProcessValidations(arg0);
	} else if (PhaseId.RENDER_RESPONSE.equals(curId)) {
		doBeforeRenderResponse(arg0);
	} else if (PhaseId.RESTORE_VIEW.equals(curId)) {
		doBeforeRestoreView(arg0);
	} else if (PhaseId.UPDATE_MODEL_VALUES.equals(curId)) {
		doBeforeUpdateModel(arg0);
	}
	doBeforeEveryPhase(arg0);
}
 
開發者ID:OpenNTF,項目名稱:xsp.extlib,代碼行數:18,代碼來源:PhaseListener.java

示例6: afterPhase

import javax.faces.event.PhaseEvent; //導入方法依賴的package包/類
@Override
public void afterPhase(final PhaseEvent arg0) {
	PhaseId curId = arg0.getPhaseId();
	if (PhaseId.APPLY_REQUEST_VALUES.equals(curId)) {
		doAfterApplyRequest(arg0);
	} else if (PhaseId.INVOKE_APPLICATION.equals(curId)) {
		doAfterInvokeApplication(arg0);
	} else if (PhaseId.PROCESS_VALIDATIONS.equals(curId)) {
		doAfterProcessValidations(arg0);
	} else if (PhaseId.RENDER_RESPONSE.equals(curId)) {
		doAfterRenderResponse(arg0);
	} else if (PhaseId.RESTORE_VIEW.equals(curId)) {
		doAfterRestoreView(arg0);
	} else if (PhaseId.UPDATE_MODEL_VALUES.equals(curId)) {
		doAfterUpdateModel(arg0);
	}
	doAfterEveryPhase(arg0);
}
 
開發者ID:OpenNTF,項目名稱:org.openntf.domino,代碼行數:19,代碼來源:PhaseListener.java

示例7: beforePhase

import javax.faces.event.PhaseEvent; //導入方法依賴的package包/類
@Override
public void beforePhase(final PhaseEvent arg0) {
	doBeforeEveryPhase(arg0);
	PhaseId curId = arg0.getPhaseId();
	if (PhaseId.APPLY_REQUEST_VALUES.equals(curId)) {
		doBeforeApplyRequest(arg0);
	} else if (PhaseId.INVOKE_APPLICATION.equals(curId)) {
		doBeforeInvokeApplication(arg0);
	} else if (PhaseId.PROCESS_VALIDATIONS.equals(curId)) {
		doBeforeProcessValidations(arg0);
	} else if (PhaseId.RENDER_RESPONSE.equals(curId)) {
		doBeforeRenderResponse(arg0);
	} else if (PhaseId.RESTORE_VIEW.equals(curId)) {
		doBeforeRestoreView(arg0);
	} else if (PhaseId.UPDATE_MODEL_VALUES.equals(curId)) {
		doBeforeUpdateModel(arg0);
	}
}
 
開發者ID:OpenNTF,項目名稱:org.openntf.domino,代碼行數:19,代碼來源:PhaseListener.java

示例8: afterPhase

import javax.faces.event.PhaseEvent; //導入方法依賴的package包/類
@Override
public void afterPhase(PhaseEvent event)
{
    // Set an attribute on to the session just so that we can force the session to get serialized
    // We target the invoke application phase as well since the redirects get issued at that stage.
    if (event.getPhaseId() == PhaseId.INVOKE_APPLICATION || event.getPhaseId() == PhaseId.RENDER_RESPONSE)
    {
        final String METHOD_NAME = "afterPhase";
        LOGGER.logp(Level.FINEST, CLASS_NAME, METHOD_NAME, "Adding a random attribute to the session map.");
        Map<String, Object> sessionMap = event.getFacesContext().getExternalContext().getSessionMap();
        if (sessionMap != null)
        {
            sessionMap.put("__timestamp__", System.currentTimeMillis());
        }
    }
}
 
開發者ID:roguexz,項目名稱:gae-java-template,代碼行數:17,代碼來源:SessionSerializationListener.java

示例9: broadcastBeforeEvent

import javax.faces.event.PhaseEvent; //導入方法依賴的package包/類
protected void broadcastBeforeEvent(PhaseEvent phaseEvent)
{
    //TODO discuss exception handling

    //fire to phase-observer methods
    this.phaseEvent.select(createAnnotationLiteral(phaseEvent.getPhaseId(), true)).fire(phaseEvent);
    this.beforeAnyPhaseEvent.fire(phaseEvent);

    //fire to ds-phase-listeners
    for (PhaseListener phaseListener : this.phaseListeners)
    {
        PhaseId targetPhase = phaseListener.getPhaseId();

        if (targetPhase == PhaseId.ANY_PHASE || targetPhase == phaseEvent.getPhaseId())
        {
            phaseListener.beforePhase(phaseEvent);
        }
    }
}
 
開發者ID:apache,項目名稱:deltaspike,代碼行數:20,代碼來源:JsfRequestLifecycleBroadcaster.java

示例10: broadcastAfterEvent

import javax.faces.event.PhaseEvent; //導入方法依賴的package包/類
protected void broadcastAfterEvent(PhaseEvent phaseEvent)
{
    //TODO discuss exception handling

    //fire to phase-observer methods
    this.phaseEvent.select(createAnnotationLiteral(phaseEvent.getPhaseId(), false)).fire(phaseEvent);
    this.afterAnyPhaseEvent.fire(phaseEvent);

    //fire to ds-phase-listeners
    //call the listeners in reverse-order (like jsf)
    ListIterator<PhaseListener> phaseListenerIterator = this.phaseListeners.listIterator(phaseListeners.size());

    while (phaseListenerIterator.hasPrevious())
    {
        PhaseListener phaseListener = phaseListenerIterator.previous();
        PhaseId targetPhase = phaseListener.getPhaseId();

        if (targetPhase == PhaseId.ANY_PHASE || targetPhase == phaseEvent.getPhaseId())
        {
            phaseListener.afterPhase(phaseEvent);
        }
    }
}
 
開發者ID:apache,項目名稱:deltaspike,代碼行數:24,代碼來源:JsfRequestLifecycleBroadcaster.java

示例11: beforePhase

import javax.faces.event.PhaseEvent; //導入方法依賴的package包/類
/**
 * Handle a notification that the processing for a particular phase of the
 * request processing lifecycle is about to begin.
 */
public void beforePhase(PhaseEvent event) {

	if(event.getPhaseId() == PhaseId.RENDER_RESPONSE) {
		FacesContext facesContext = event.getFacesContext();
		restoreMessages(facesContext);
	}
}
 
開發者ID:hantsy,項目名稱:javaee8-jsf-sample,代碼行數:12,代碼來源:MessageHandler.java

示例12: afterPhase

import javax.faces.event.PhaseEvent; //導入方法依賴的package包/類
/**
 * Handle a notification that the processing for a particular phase has just
 * been completed.
 */
public void afterPhase(PhaseEvent event) {

	if(event.getPhaseId() == PhaseId.APPLY_REQUEST_VALUES ||
			event.getPhaseId() == PhaseId.PROCESS_VALIDATIONS ||
			event.getPhaseId() == PhaseId.UPDATE_MODEL_VALUES || 
			event.getPhaseId() == PhaseId.INVOKE_APPLICATION) {

		FacesContext facesContext = event.getFacesContext();
		saveMessages(facesContext);
	}

}
 
開發者ID:hantsy,項目名稱:javaee8-jsf-sample,代碼行數:17,代碼來源:MessageHandler.java

示例13: beforePhase

import javax.faces.event.PhaseEvent; //導入方法依賴的package包/類
/**
 * in RENDER_RESPONSE restore facesMessages
 */
public void beforePhase(PhaseEvent event) {
    if (event.getPhaseId() == PhaseId.RENDER_RESPONSE) {
        FacesContext facesContext = event.getFacesContext();
        restoreMessages(facesContext);
    }
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:10,代碼來源:MessageHandler.java

示例14: afterPhase

import javax.faces.event.PhaseEvent; //導入方法依賴的package包/類
/**
 * save messages after APPLY_REQUEST_VALUES, PROCESS_VALIDATIONS,
 * INVOKE_APPLICATION
 */
public void afterPhase(PhaseEvent event) {
    if (event.getPhaseId() == PhaseId.APPLY_REQUEST_VALUES
            || event.getPhaseId() == PhaseId.PROCESS_VALIDATIONS
            || event.getPhaseId() == PhaseId.INVOKE_APPLICATION) {
        FacesContext facesContext = event.getFacesContext();
        saveMessages(facesContext);
    }
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:13,代碼來源:MessageHandler.java

示例15: beforePhase

import javax.faces.event.PhaseEvent; //導入方法依賴的package包/類
public void beforePhase(PhaseEvent event) {
    PhaseId phaseId = event.getPhaseId();
    if (PhaseId.PROCESS_VALIDATIONS.equals(phaseId)
            || PhaseId.RENDER_RESPONSE.equals(phaseId)) {
        JSFUtils.verifyViewLocale();
    }
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:8,代碼來源:LocaleListener.java


注:本文中的javax.faces.event.PhaseEvent.getPhaseId方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。