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


Java PhaseId.INVOKE_APPLICATION屬性代碼示例

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


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

示例1: beforeAndAfterPhaseWithMultipleTargets

@Test
public void beforeAndAfterPhaseWithMultipleTargets() {
	TestListener target1 = new TestListener();
	TestListener target2 = new TestListener();
	beanFactory.addBean("testListener1", target1);
	beanFactory.addBean("testListener2", target2);

	assertEquals(delPhaseListener.getPhaseId(), PhaseId.ANY_PHASE);
	PhaseEvent event = new PhaseEvent(facesContext, PhaseId.INVOKE_APPLICATION, new MockLifecycle());

	delPhaseListener.beforePhase(event);
	assertTrue(target1.beforeCalled);
	assertTrue(target2.beforeCalled);

	delPhaseListener.afterPhase(event);
	assertTrue(target1.afterCalled);
	assertTrue(target2.afterCalled);
}
 
開發者ID:langtianya,項目名稱:spring4-understanding,代碼行數:18,代碼來源:DelegatingPhaseListenerTests.java

示例2: testBeforeAndAfterPhaseWithMultipleTargets

public void testBeforeAndAfterPhaseWithMultipleTargets() {
	TestListener target1 = new TestListener();
	TestListener target2 = new TestListener();
	beanFactory.addBean("testListener1", target1);
	beanFactory.addBean("testListener2", target2);

	assertEquals(delPhaseListener.getPhaseId(), PhaseId.ANY_PHASE);
	PhaseEvent event = new PhaseEvent(facesContext, PhaseId.INVOKE_APPLICATION, new MockLifecycle());

	delPhaseListener.beforePhase(event);
	assertTrue(target1.beforeCalled);
	assertTrue(target2.beforeCalled);

	delPhaseListener.afterPhase(event);
	assertTrue(target1.afterCalled);
	assertTrue(target2.afterCalled);
}
 
開發者ID:deathspeeder,項目名稱:class-guard,代碼行數:17,代碼來源:DelegatingPhaseListenerTests.java

示例3: afterPhase

@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,代碼行數:16,代碼來源:SessionSerializationListener.java

示例4: afterPhase

/**
 * 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,代碼行數:16,代碼來源:MessageHandler.java

示例5: afterPhase

/**
 * 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,代碼行數:12,代碼來源:MessageHandler.java

示例6: beforeAndAfterPhaseWithSingleTarget

@Test
public void beforeAndAfterPhaseWithSingleTarget() {
	TestListener target = new TestListener();
	beanFactory.addBean("testListener", target);

	assertEquals(delPhaseListener.getPhaseId(), PhaseId.ANY_PHASE);
	PhaseEvent event = new PhaseEvent(facesContext, PhaseId.INVOKE_APPLICATION, new MockLifecycle());

	delPhaseListener.beforePhase(event);
	assertTrue(target.beforeCalled);

	delPhaseListener.afterPhase(event);
	assertTrue(target.afterCalled);
}
 
開發者ID:langtianya,項目名稱:spring4-understanding,代碼行數:14,代碼來源:DelegatingPhaseListenerTests.java

示例7: testBeforeAndAfterPhaseWithSingleTarget

public void testBeforeAndAfterPhaseWithSingleTarget() {
	TestListener target = new TestListener();
	beanFactory.addBean("testListener", target);

	assertEquals(delPhaseListener.getPhaseId(), PhaseId.ANY_PHASE);
	PhaseEvent event = new PhaseEvent(facesContext, PhaseId.INVOKE_APPLICATION, new MockLifecycle());

	delPhaseListener.beforePhase(event);
	assertTrue(target.beforeCalled);

	delPhaseListener.afterPhase(event);
	assertTrue(target.afterCalled);
}
 
開發者ID:deathspeeder,項目名稱:class-guard,代碼行數:13,代碼來源:DelegatingPhaseListenerTests.java

示例8: goToPage2

public void goToPage2(ValueChangeEvent event) {
    if (event.getPhaseId() != PhaseId.INVOKE_APPLICATION) {
        event.setPhaseId(PhaseId.INVOKE_APPLICATION);
        event.queue();
    } else {
        // refresh current page state.
        goToPage(null);
    }
}
 
開發者ID:pdf4j,項目名稱:icepdf,代碼行數:9,代碼來源:DocumentManager.java

示例9: documentZoomLevelChange

public void documentZoomLevelChange(ValueChangeEvent event) {
    if (event.getPhaseId() != PhaseId.INVOKE_APPLICATION) {
        event.setPhaseId(PhaseId.INVOKE_APPLICATION);
        event.queue();
    } else {
        // refresh current page state.
        refreshDocumentState();
    }
}
 
開發者ID:pdf4j,項目名稱:icepdf,代碼行數:9,代碼來源:DocumentManager.java

示例10: ResetInputAjaxActionListener

/**
 * Construct a new reset input ajax action listener around the given wrapped action listener. This constructor
 * will be used when registering as <code>&lt;action-listener&gt;</code> in <code>faces-config.xml</code>.
 * @param wrapped The wrapped action listener.
 */
public ResetInputAjaxActionListener(ActionListener wrapped) {
	super(PhaseId.INVOKE_APPLICATION);
	this.wrapped = wrapped;
}
 
開發者ID:phoenixctms,項目名稱:ctsms,代碼行數:9,代碼來源:ResetInputAjaxActionListener.java


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