سؤال

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?

هل كانت مفيدة؟

المحلول

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

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top