struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Per Johansson <>
Subject RequiredFieldValidator and error message from property file via key
Date Fri, 04 Dec 2009 10:25:18 GMT

I'm trying to get error messages from a resource bundle.

This is the code for my action class:

key="myFieldErrorMsg", message="Error!!!!")
public void setMyField(int myField) {
    this.myField = myField;

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:
For additional commands, e-mail:

View raw message