Re: ensuring valid forwards

2005-06-14 Thread Adam Hardy
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

Re: ensuring valid forwards

2005-06-14 Thread Dave Newton
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

Re: ensuring valid forwards

2005-06-14 Thread Frank W. Zammetti
PM Subject Re: ensuring valid forwards Please respond to Struts Users Mailing List [EMAIL PROTECTED] he.org

ensuring valid forwards

2005-06-13 Thread Dan Tenenbaum
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

Re: ensuring valid forwards

2005-06-13 Thread Frank W. Zammetti
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

Re: ensuring valid forwards

2005-06-13 Thread Hubert Rabago
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

Re: ensuring valid forwards

2005-06-13 Thread Dan Tenenbaum
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.

Re: ensuring valid forwards

2005-06-13 Thread Michael Jouravlev
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