tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rob S." <>
Subject RE: Exceptional Question
Date Fri, 07 Jul 2000 03:14:07 GMT
> In the Struts framework (, I approached
> this
> issue by having a validate() method in my form bean return a String
> array of
> messages for all of the errors that have been detected, rather than
> throwing
> exceptions on individual fields.  That way, I can display all the errors
> at
> once.

Ahhh k, those messages being keys to the MessageResource and set to the
localized message, displayed using <struts:error/>.  I gave a preliminary
read through the MVC intro doc, which was a rock and roll adventure.  I've
only heard of it before, so it was sort of thick.  I'm sure the more
experienced web people will probably get it a lot more quickly tho'.  What I
*do* like is the use of an errors collection & keys, which makes things

<%= errors.get(Bean.ATTR_ERROR) %>

much cleaner than having to deal with individualized exceptions and more
flexible than only being able to display the latest error.  Less powerful &
efficient overall, but perhaps more appropriate for small-time sites (mine

One thing I'm tempted to do is figure out elegant ways to only use
get/setProperty to get all of my bean work done.  Doesn't usually turn out
that way tho' =)  I wonder if the next JSP spec will provide more powerful
bean tags.

- r

View raw message