Better control over field conversion errors than invalid.fieldvalue.xxx
-----------------------------------------------------------------------

                 Key: WW-1770
                 URL: https://issues.apache.org/struts/browse/WW-1770
             Project: Struts 2
          Issue Type: Improvement
    Affects Versions: 2.0.6
            Reporter: Sami Dalouche
            Priority: Minor


Any Application Design that follows a rich-domain paradigm (e.g. Domain Driven 
Design) will necessarily implement business validation rules in domain 
entities. Some Integrity-checking rules can be implemented as "throw new 
WhateverBusinessException()" right in the object mutators (aka setters) to 
avoid having an undefined object state.

Since Struts2/XWork/OGNL is supposed to help binding data directly to domain 
entities, it seems natural to help the application report the correct errors to 
the user. However, if a setter throws an exception, the only customizable 
message is invalid.fieldvalue.xxx, which means that if the setter can throw 10 
exceptions, only one generic message can be displayed to the user.

As a result, it would  be useful to be able to customize the error message 
using the exception thrown, and not just the field name Something such as :
invalid.path.to.Exception.xxx
where path.to.Exception is the FQ class name, and xxx is the field name.

 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to