本文整理匯總了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();
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
示例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());
}
}
}
示例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);
}
}
}
示例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);
}
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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();
}
}