无法在JSF阶段侦听器中停止处理请求

时间:2012-12-12 11:12:44

标签: jsf jsf-2

在阶段监听器中,我无法停止处理。 jsf不关心我的回复完成调用。如何在阶段监听器中停止处理?

@Override
public PhaseId getPhaseId() {return PhaseId.RESTORE_VIEW;}

@Override
public void beforePhase(PhaseEvent event) {}

@Override
public void afterPhase(PhaseEvent event) {
    FacesContext fc = FacesContext.getCurrentInstance();
    UIViewRoot viewRoot = fc.getViewRoot();
    if (checkweirdcase()) {
        LOGGER.debug("ViewId " + viewRoot.getViewId());
    } else {
        event.getFacesContext().responseComplete();
    }
    LOGGER.debug(event.getPhaseId());
}

0 个答案:

没有答案