I use Struts' declarative exception handling abilities to handle
manager-layer validation errors. Exceptions that are not caught by your
Actions can be configured to be handled by Struts' default exception
handler, or even better, your own exception handler (Struts is easy to
extend in this fashion). The Exception handler looks up an appropriate
message (for the user) in a resource bundle, just as the Validator
plugin does when it encounters exceptions.
Erik
Rooney.Dave wrote:
Hi folks!
My apologies if this has been asked before - I looked through the FAQ's
and archives, but couldn't find any pertinent answers.
We have several applications that use a common code base, and have both
a Swing and Web (Struts/JSP) front end. The business validation logic
for the application is shared so that we have minimal duplication of
code.
A problem that we're having is providing good feedback to the users for
validation errors in the Web applications. We're not using the Struts
validation framework since it deals with the form beans, which aren't
the same as the domain models that our validation logic works with. As
a result, we don't have a direct correlation between a property in a
domain model that has failed a validation and the field on the web page
that represents that property.
One solution would be to update all of our domain models to use the
Commons validation framework, but that (IMO) would introduce
considerable risk since our current validation logic works fine.
Another idea we had was to create some sort of mapping between domain
model properties and the form properties so that we could associate a
validation error with a specific field on a form. I haven't tried that
approach, but my gut feeling is that it would be quite 'brittle'.
Does anyone have any ideas on this?
Thanks in advance!
Dave Rooney
Secure Systems Development
[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]