myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cote.M...@hydro.qc.ca
Subject Error handling & redirecting from BB constructor possible ?
Date Fri, 03 Dec 2004 18:24:13 GMT
Does anybody know how to go about redirecting to an error
page from the constructor of a backing bean.
 
For example:
 
class BBean
{
     Data someData;
     
     public BBean ()
     {
           try
           {
            someData = getData();
           }
           catch(Throwable t)
           {
            // What is the code here to redirect to an error page ?
           }
     }
     
     ....
}
 
I tried using
FacesContext.getCurrentInstance().getExternalContext().dispatch("error.jsp")
;
but I got a response already rendered error.
 
Thanks
 
Mark

Mime
View raw message