我有以下 JSF 支持 bean 方法,它应该根据某些条件执行重定向。
public void navigationStatus() throws IOException {
log(LogMessages.getLogString(user, currentDatasource, nomeClasse, "navigationStatus", "navigationStatus"), null);
logger.debug("INSIDE navigationStatus ");
FacesContext context = FacesContext.getCurrentInstance();
HttpServletResponse response = (HttpServletResponse) context.getExternalContext().getResponse();
if (!isUserEnabled()) {
log(LogMessages.getLogString(user, currentDatasource, nomeClasse, "navigationStatus", "Sessione utente SCADUTA"), null);
logger.debug("Sessione utente SCADUTA");
response.sendRedirect("error.jsp");
}
}
然而,这并不适用于所有页面。它适用于某些页面,但不适用于其他页面。这是如何引起的,我该如何解决?