I am trying to use the @CustomValidator, but I could not discover what the
fieldName does.
When using the Action-validation.xml I wrote an entry:
[code]
<field name="person.name">
<field-validator type="customValidator">
<message>blabla</message>
</field-validator>
</field>
[/code]
so I thought that if I used the annotation in the action...
[code]
private Person person;
@CustomValidator(type = "customValidator", fieldName = "person.name")
public Person getPerson() {
return this.person;
}
and the Person class is:
public class Person {
private String name;
private Integer age;
// getters & setters
}
[/code]
... I thought I would obtain the same effect as the xml entry.
That is not the case, could someone tell me what's happening and what exactly
does the fieldName does?
I'm using Struts 2.0.5 beta + Tomcat 5.5.20.
Little mistakes in the api docs:
- the api docs tells that the attribute type has the ValidatorType.FIELD as
default, when in fact, this attribute is mandatory and must be the name of your
custom made validator.
- and there's nothing about the fieldName attribute...
Thanks in advance.
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=65022&messageID=124679#124679
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]