当前位置: 首页>>代码示例>>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;未经允许,请勿转载。