Title: RE: Error handling & redirecting from BB constructor possible ?

Heath,

I tried this also (but forgot to mention), followed by "FacesContext.getCurrentInstance().responseComplete()"
but the request keeps processing the same jsp & the redirect never happens.

Is there any other way to handle errors inside BB constructor ?
In other words, I would expect most apps to have to deal with this...





-----Message d'origine-----
De : Heath Borders [mailto:[EMAIL PROTECTED]]
Envoy� : vendredi 3 d�cembre 2004 14:22
� : MyFaces Discussion
Objet : Re: Error handling & redirecting from BB constructor possible ?

Call FacesContext.getCurrentInstance().getExternalContext().redirect(String)


On Fri, 3 Dec 2004 13:24:13 -0500, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> 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


--
If you don't have a GMail account, I probably have 5 invites.  Just ask!
-Heath Borders-Wing
[EMAIL PROTECTED]

Reply via email to