0

在阶段侦听器中,我无法停止处理。jsf 不在乎我的 responseComplete 调用。如何在阶段侦听器中停止处理?

@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());
}
4

0 回答 0