I have the following JSF backing bean method which should perform a redirect depending on some condition.
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");
}
}
This does however not work on all pages. It works on some pages, but not on other pages. How is this caused and how can I solve it?