This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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
Author

"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".


Merrill
Consultant, Sima Solutions
Mark Beavis
Ranch Hand

Joined: Apr 07, 2005
Posts: 43
Thanks a lot Merrill!
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: "null is requred" validation message
 
It's not a secret anymore!