wood burning stoves 2.0*
The moose likes Struts and the fly likes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark ""null is requred" validation message" Watch ""null is requred" validation message" New topic

"null is requred" validation message

Mark Beavis
Ranch Hand

Joined: Apr 07, 2005
Posts: 43
Hi everyone -

I'm a beginner in Struts and am just trying to introduce validation onto my form for the first time. The good news is that the form is validating, however a sensible error message is not being returned.

My form bean property:

My validation rule:

I'm using the struts blank project that comes with the struts 1.3.5 download and I haven't changed anything apart from the above.

Can anyone help out - Thanks
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
You must add a message key to your MessageResources.properties file that matches the key you specified. Example:

Once you change this, redeploy, and restart the server, the message should read "Type is required".

Consultant, Sima Solutions
Mark Beavis
Ranch Hand

Joined: Apr 07, 2005
Posts: 43
Thanks a lot Merrill!
It is sorta covered in the JavaRanch Style Guide.
subject: "null is requred" validation message
Similar Threads
Struts Indexed properties client side validation
Validation Issue
What Are the Causes for Validation Not Doing Anything?
Why My Validation Lets All Errors Pass Through?
Struts validation not working