i just want to print an custom message on a error page, when an exception occurs.
i tried this
if(erroroccured){
FacesMessage message=new FacesMessage("You must login to continue");
context.addMessage(null, message);
FacesContext.getCurrentInstance().getExternalContext().redirect("error.xhtml");
}
In error.xhtml i gave the
<h:messages></h:messages>
tag too.. whenever the exception occurs my page is been redirected perfectly. but i dint get any error msg.