You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Co...@hydro.qc.ca on 2004/12/08 21:39:27 UTC

RE: Exception mapping to error page in web.xml not working with t iles and myfaces ?

Right on Heath ! ....partly :)
My exception was being wrapped, not by a Servlet or Tiles exception, but by
FacesException !

I was expecting to throw MyException and be able to define specifically
MyException in web.xml.
Any documentation/specs on this functionality ?  
 
Thanks again !

Mark


-----Message d'origine-----
De : Heath Borders [mailto:heath.borders@gmail.com] 
Envoyé : mercredi 8 décembre 2004 15:11
À : MyFaces Discussion
Objet : Re: Exception mapping to error page in web.xml not working with
tiles and myfaces ?

Ours works fine.  Here are our error page definitions:

<error-page>
		<error-code>500</error-code>
		<location>/error.jsp</location>
	</error-page>
	<error-page>
	
<exception-type>org.apache.struts.tiles.TilesException</exception-type>
		<location>/error.jsp</location>
	</error-page>
	<error-page>
	
<exception-type>javax.servlet.ServletException</exception-type>
		<location>/error.jsp</location>
	</error-page>

My guess is that your error is getting wrapped either by a ServletException
or a TilesException


On Wed, 8 Dec 2004 15:06:34 -0500, Cote.Mark@hydro.qc.ca
<Co...@hydro.qc.ca> wrote:
> 
> We are not able to get the functionality of exception mapping to work.
> We are using myfaces 1.0.7 & tiles. 
>  
> I have an <error-page> entry in web.xml which I have mapped to an 
> exception(derived from RunTime) which is thrown from a constructor in 
> one of my BBeans. Whenever the exception is thrown, the mapping is 
> never acknowledged and the BBean is processed in the regular way...but 
> with errors since the data was never loaded.
>  
> The <error-page> mapping functionality works well when I run a webapp 
> not using jsf and tiles, but fails to work when used with them.
>  
> Has anyone been able to get this functionality to work with jsf and tiles
?
>  
>  
> Thanks in advance !
>  
> Mark
>  
>  


--
If you don't have a GMail account, I probably have 5 invites.  Just ask!
-Heath Borders-Wing
hborders@mail.win.org

Re: Exception mapping to error page in web.xml not working with t iles and myfaces ?

Posted by Heath Borders <he...@gmail.com>.
I think there is some documentation as to what comes out of the
FacesServlet, and I'm sure there are docs about what comes out o the
TilesServlet.  They best way to figure it out is to look at the code
of the respective servlets.

I think for the FacesServlet, it will wrap any Throwable it catches
inside a ServletException except for IOExceptions and
ServletExceptions.  However, your container might unwrap those
ServletExceptions and get the underlying cause.

Either way, probably the easiest thing to do would be to set the
redirect to a 500 error code.


On Wed, 8 Dec 2004 15:39:27 -0500, Cote.Mark@hydro.qc.ca
<Co...@hydro.qc.ca> wrote:
> 
> 
> 
> Right on Heath ! ....partly :) 
> My exception was being wrapped, not by a Servlet or Tiles exception, but by
> FacesException ! 
> 
> I was expecting to throw MyException and be able to define specifically
> MyException in web.xml. 
> Any documentation/specs on this functionality ?  
>   
> Thanks again ! 
> 
> Mark 
> 
> 
> -----Message d'origine----- 
> De : Heath Borders [mailto:heath.borders@gmail.com] 
> Envoyé : mercredi 8 décembre 2004 15:11 
> À : MyFaces Discussion 
> Objet : Re: Exception mapping to error page in web.xml not working with
> tiles and myfaces ? 
> 
> Ours works fine.  Here are our error page definitions: 
> 
> <error-page> 
>                 <error-code>500</error-code> 
>                 <location>/error.jsp</location> 
>         </error-page> 
>         <error-page> 
>                
> <exception-type>org.apache.struts.tiles.TilesException</exception-type> 
>                 <location>/error.jsp</location> 
>         </error-page> 
>         <error-page> 
>                
> <exception-type>javax.servlet.ServletException</exception-type> 
>                 <location>/error.jsp</location> 
>         </error-page> 
> 
> My guess is that your error is getting wrapped either by a ServletException
> or a TilesException 
> 
> 
> On Wed, 8 Dec 2004 15:06:34 -0500, Cote.Mark@hydro.qc.ca
> <Co...@hydro.qc.ca> wrote: 
> > 
> > We are not able to get the functionality of exception mapping to work. 
> > We are using myfaces 1.0.7 & tiles. 
> >  
> > I have an <error-page> entry in web.xml which I have mapped to an 
> > exception(derived from RunTime) which is thrown from a constructor in 
> > one of my BBeans. Whenever the exception is thrown, the mapping is 
> > never acknowledged and the BBean is processed in the regular way...but 
> > with errors since the data was never loaded. 
> >  
> > The <error-page> mapping functionality works well when I run a webapp 
> > not using jsf and tiles, but fails to work when used with them. 
> >  
> > Has anyone been able to get this functionality to work with jsf and tiles
> ? 
> >  
> >  
> > Thanks in advance ! 
> >  
> > Mark 
> >  
> >  
> 
> 
> -- 
> If you don't have a GMail account, I probably have 5 invites.  Just ask! 
> -Heath Borders-Wing 
> hborders@mail.win.org 


-- 
If you don't have a GMail account, I probably have 5 invites.  Just ask!
-Heath Borders-Wing
hborders@mail.win.org