Re: [Webwork-devel] Action load error handling in ServletDispatcher...
Brought to you by:
baldree,
rickardoberg
From: Matt B. <ma...@sm...> - 2002-05-17 03:42:53
|
see comments below ----- Original Message ----- From: "Joel Peach" <jp...@tr...> To: <web...@li...> Sent: Tuesday, May 07, 2002 9:38 AM Subject: [Webwork-devel] Action load error handling in ServletDispatcher... > Developers, > > I'm in the process of creating a custom action factory proxy to handle authentication and authorization requirements in our system that can't be serviced by container-managed auth. I've noticed a potential issue in the way ServletDispatcher handles errors from the ActionFactoryProxy chain when loading the action and wanted to bring it to your attention as I create a patch. > The problem with the patch is the scenario where you may be trying to go to the action which failed to be created. For instance ERROR might map to the action that threw the exception. The way it is now, you can map back to the same action and everything is fine. > I've looked through the commit logs and the archives of this list and haven't been able to find much in the way of how errors are to be addressed in the ActionFactoryProxy chain. Looking at ServletDispatcher, it seems when ActionFactory.getAction() is called, all Exceptions are trapped and a 404 error is sent back to the browser via the servlet response. > > However, in ParametersActionFactoryProxy, a patch was committed (revision 1.7) to trap IllegalArgumentException while setting the action properties and propogate them to the ServletDispatcher as a ResultException. The comment to the commit and in the source file for ParametersActionFactoryProxy indicate that the ResultException is to result in the error view getting displayed for the action. Unfortunately, with the way ServletDispatcher is handling exceptions at this point, the expected behavior will never occur. Hmm. It works. I checked in the FormTest where it throws IllegalArgumentException instead of using doValidate(). Take a look at it. > > I'm wondering if I'm missing some subtlety of exception handling for the action factory proxy chain or if the ServletDispatcher is in need of a way to flexibly handle errors that occur as the Action is being instantiated? > > As I've been working on this patch, I've encountered some difficulty resulting from the structure of ServletDispatcher's service() method and that the action variable in that method is declared final. As far as I can tell the declaration of the action variable as final is to prevent code further down in the method from overwriting the variable after it has been loaded. Can anyone please shed light on this? > > Help much appreciated and I look forward to being able to help out, > > -Joel > > > > > =================== > Joel Peach > Tracerdigital, LLC > 7632 Choctaw Place > Columbus, OH > United States > p: (614) 540-3055 > e: jp...@tr... > n()ފJqhᮧzج$xhyhi +ge ^ bދzaz۷ *'fⶢKjwpa۲q z՞o > +ׯzYXXgu ޖX(˺~zwi۳ l˲q z l X)ߣo > + |