The best way that I have found to counter this is to stick rigidly to a
limited set of forward names, such as 'display', 'failed', 'insert',
'delete'. Hard-code them in a utility class as string finals, or as an
enum if you use jdk 1.5.
Make it part of your coding convention only to refer to
David Whipple wrote:
I would really like to see this as well.
+1
I had a very convoluted solution involving pre-processing my
java/jsp/xml files (mostly for the automagic creation of web app
documentation along with the bulk of CRUD actions/form
pre-population/etc.) but an exception
PM
Subject
Re: ensuring valid forwards
Please respond to
Struts Users
Mailing List
[EMAIL PROTECTED]
he.org
My codebase has a lot of lines like this in struts actions:
return mapping.findForward(foo);
If I make a typo and it turns out that foo is not a valid forward
according to the struts config file, when I hit the action in the
browser, I get a blank page. Not my designated error page.
Is there
You can configure a global exception handler, although I'm not 100% sure
it will catch this type of problem.
You can find the documentation online in the usual place, but it basically
amounts to this in struts-config:
global-exceptions
exception
I recently checked in a change that would log a warning if
mapping.findForward was called with a forward name that wasn't
recognized. This change didn't make it to the 1.2.7 release, but is
available from nightly builds. Apart from that, it wouldn't be too
hard to customize/extend your Struts
On 6/13/05, Frank W. Zammetti [EMAIL PROTECTED] wrote:
But again, I'm not certain this type of problem will be caught because I'm
not even sure an exception is thrown in such a case. If it isn't that
strikes me as a bug. Anyone else know for sure?
I don't think it does throw an exception.
It was discussed, but I could not find a bug in Bugzilla. Yep,
choosing between an exception and blank screen, I would prefer an
exception with forward name.
Michael.
On 6/13/05, Frank W. Zammetti [EMAIL PROTECTED] wrote:
Yeah, that seemed a little too easy :)
I would think it should throw
8 matches
Mail list logo