Question

What can be cause of not working redirection in this case?

@HandlesExceptions
public class ExceptionHandler {
    public void handleException(@Handles CaughtException<Throwable> e,
                                Messages messages      
                                FacesContext facesContext){

        messages.error("something went wrong");
        facesContext.getApplication().getNavigationHandler()    
                .handleNavigation(facesContext, null, "foopage");
    }
}

I'm sure that exception handler method is processed. How can I redirect to some error page in exception handler method?

Was it helpful?

Solution

after calling "handleNavigation", you should call : facescontext.renderResponse();

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top