jQuery in Action, 2nd edition*
The moose likes Struts and the fly likes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
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!
I agree. Here's the link: http://aspose.com/file-tools
subject: "null is requred" validation message
Similar Threads
Validation Issue
Why My Validation Lets All Errors Pass Through?
Struts Indexed properties client side validation
What Are the Causes for Validation Not Doing Anything?
Struts validation not working