Maurizio Cucchiara wrote:
>
> Ok,
> try this
>
> @VisitorFieldValidator(fieldName = "YOUR FIELD NAME", appendPrefix =
> true, message = "YOUR MESSAGE")
>
> Struts should use Field Name like a prefix for every invalid element
> inside the annotated object.
>
This doesn't work as I would expect;
@VisitorFieldValidator(fieldName = "YOUR FIELD NAME", appendPrefix = true,
message = "YOUR MESSAGE") outputs <Your Message><Message generated by the
error condition>
@VisitorFieldValidator(fieldName = "YOUR FIELD NAME", appendPrefix = true,
message = " ")
outputs <null><Message generated by the error condition>
@VisitorFieldValidator(fieldName = "YOUR FIELD NAME", appendPrefix = false,
message = " ") or
@VisitorFieldValidator(fieldName = "YOUR FIELD NAME", appendPrefix = false,
message = "YOUR MESSAGE ")
outputs no error message at all.
It doesn't make any difference whether I include the fieldName="YOUR FIELD
NAME" or not, the string "YOUR FIELD NAME" never appears in the ouput.
I'm using 2.0.18 if that's of any relevance. I would have expected that
specifying either appendPrefix=false or appendPrefix=true, message=" " to
display only the generated error message. What is the fieldName attribute
for?
Regards
--
View this message in context:
http://old.nabble.com/%40VisitorFieldValidator-message-formatting-question.-tp30405050p30417193.html
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org