struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Darren Boyd <>
Subject [shale] ShalePhaseListener behaviour when ViewController throws exceptions
Date Wed, 21 Dec 2005 16:53:56 GMT

I've come across an issue with the ShalePhaseListener that occurs 
whenever a ViewController throws an exception.

We are using MyFaces 1.1.1 in a project but have also included 
shale-core.jar and shale-spring.jar to take advantage of the shale's 
ViewController functionality (which is a lifesaver for us, btw, thanks!).

We are encountering a problem whenever our ViewController throws an 
exception from a ViewController.prerender() call.  The exception makes 
its way to the container which is configured to forward to a custom 
error page.  This error page is a JSF page (which is not mapped to a 
ViewController) and the PhaseListener calls the same 
ViewController.prerender() a second time which generates the same 
exception.  At this point the container (Tomcat) simply generates the 
default 'Error 500' page.

The problem seems to be a simple piece of code in the ShaleViewHandler. 
  In the beforeRenderResponse(PhaseEvent) method we have the following...

     Map map =
     ViewController vc = (ViewController)
     if (vc == null) {

I believe that the map.remove() statement should be called before the 
vc.prerender().  That should ensure that the prerender is only called 
once in a request.  This same issue might exist for preprocess() as 
well, but I'm not that familiar with the code to completely understand 
it.  I am confident it isn't an issue for init() or destroy().

Is this a bug?  If so, I can open a bugzilla ticket for it, provide a 
diff, etc.


Darren Boyd
Bitcraft Enterprises Inc.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message