Jacek The Java Newbie

+ Follow
since Feb 07, 2006
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jacek The Java Newbie

A typical h:message will display a common error like:

"firstName": Value is required.

This of couse looks very unprofessional, since the field name is taken directly from the name of the property in the backing bean. A pro error message would say:

"First Name": Value is required.

and the "First Name" part of course would be internationalized.

Unfortunately, there seems to be no way to make this happen! I always get this ugly, unprofessional error message instead of a nice, polished error where you can pass the proper label for a field, instead of just using the raw field name.

How can this be accomplished.
16 years ago
I defined a simple DynaValidatorForm:

Have an action that uses it:

Set up validation.xml to make "personnelID" an integer:

Properly hooked up the Javascript in the JSP:

The client-side Javascript validation works perfectly. No issue there. But, if I disable Javascript in IE and try to test the server-side valdidation, nothing happens. It happily gets to my Action even though I have entered a non-integer value into the PersonnelID field.

Help! I am losing my mind trying to figure out where is the problem in the myriad of Struts XML files.

P.S. I am using Netbeans 5.0, using its Struts support. So the web.xml and validation-rules.xml are all configured and set up properly (I believe).
[ February 07, 2006: Message edited by: Jacek The Java Newbie ]
16 years ago