Hi,
I'm trying to get error messages from a resource bundle.
This is the code for my action class:
@RequiredFieldValidator(type=ValidatorType.FIELD,
key="myFieldErrorMsg", message="Error!!!!")
public void setMyField(int myField) {
this.myField = myField;
}
@Override
public void validate() {
if (!isMyFieldValid(myField)) {
addFieldError("myField", getText("myFieldErrorMsg"));
}
}
When validation fails for setMyField I don't get the expected error
message from my resource bundle.
Instead I get a struts default error message "Invalid field value for field ..."
But when i call getText from the validate method, I get the expected
error message.
How can I get a message from a resource bundle using the annotation
based validator?
I'm using weblogic 10.0.
/Best regards, Per Johansson
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
|