struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Turner" <>
Subject RE: Another bright idea, make "indexed" work with JSTL forEach and friends
Date Sun, 05 Jan 2003 01:29:29 GMT
> From: Martin Cooper [] 
> Sigh. OK, OK.
> But three changes I'd like to see in the code you posted earlier:
> 1) Instead of calling Class.forName(), you should use
> RequestUtils.applicationClass(), to make sure the context 
> class loader is tried first.

I'll do dat.

> 2) Empty catch clauses are evil. ;-) You should at least log a debug
> message so that real problems can be debugged more easily.

Well, two of them shouldn't log anything because they are simply there
to catch the "you haven't got JSTL" case, I though about logging the
other cases but "they should never happen" (famous last words #43456),
since it would require there to be a loopTag that couldn't handle being
sent the messages it defines in the Interface, but I guess I can throw
in some logging If It Makes You Feel Good :-)

> 3) Always use braces with if clauses. I know the code has 
> plenty of cases
> where that isn't done, but it's good practice to do that. I 
> seem to recall
> Craig admitting that he should have done that in the original 
> code base.

I usually do it to, except when my old c-habits sneak in.


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

View raw message