Just starting to use Struts in anger I have found an inflexibility in the 
Struts error model that I need to get around.

Basically I want to be able to raise a single ActionError for 2 
properties.

e.g.

a password field and a confirm password field exist

if they don't match then I want to display one message saying "Password 
and confirmation password don't match"

I also want to highlight both fields.

To highlight both fields I would ideally raise a single error for each 
property.

Sadly the model doesn't seem to support multiple properties for a single 
error.

It seems that my choices will be to create a dodgy convention when raising 
messages and have a special tag lib for displaying them.

Has anyone found a nice way of doing this. It must a problem everyone has 
faced because surely most web apps have cross field validation and want to 
have a single error message that relates to the fields involved in the 
cross validation. e.g. field B cannot be foo when field A is bar.

Cheers

James

*******************Confidentiality and Privilege Notice*******************

This email is intended only to be read or used by the addressee. 
It is confidential and may contain legally privileged information. 
If you are not the addressee indicated in this message (or 
responsible for delivery of the message to such person), you 
may not copy or deliver this message to anyone, and you should 
destroy this message and kindly notify the sender by reply email. 
Confidentiality and legal privilege are not waived or lost by
reason of mistaken delivery to you.

Qantas Airways Limited
ABN 16 009 661 901

Visit Qantas online at http://www.qantas.com.au

Reply via email to