struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wendy Smoak <>
Subject Validator won't validate single required field
Date Fri, 24 Jan 2003 17:20:22 GMT

I know I'm missing something, because the struts-validator example provided
with 1.1b3 works fine.  I've compared all of my own code with the example,
and I don't see what's wrong.

In my own webapp, I set a single field as required and submit the form with
nothing in the field, it doesn't re-display the form with errors, it just
goes off to my 'unrecoverable error' because the Action logic expects that
value to be present.

Here's what I have, hopefully someone will see the problem:


<form-bean      name="chooseProfileForm"

<action    path="/chooseProfile"
       <forward name="success"         path="/" />
       <forward name="resolution"      path="/" />

<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
    <set-property property="pathnames" value="/WEB-INF/validator-rules.xml,

When the webapp starts, I see this in the logs:

09:59:02,356 - INFO org.apache.struts.validator.ValidatorPlugIn - Loading
validation rules file from '/WEB-INF/validator-rules.xml'
09:59:04,813 - INFO org.apache.commons.validator.ValidatorResources - Add
ValidatorAction: email,org.apache.struts.validator.FieldChecks
09:59:04,813 - INFO org.apache.struts.validator.ValidatorPlugIn - Loading
validation rules file from '/WEB-INF/validation.xml'
{snipped a bunch of the above lines}
09:59:05,084 - INFO org.apache.commons.validator.ValidatorResources - Adding
FormSet 'FormSet: language=null  country=null  variant=null
   Form: chooseProfileForm
		key=                 nameOrId
		property=            nameOrId
		indexedProperty=     null
		indexedListProperty= null
		depends=             required
		page=                0
		fieldOrder=          0

But when I visit the form and submit it with nothing in that field:

10:08:17,963 - DEBUG org.apache.struts.action.RequestProcessor -  Validating
input form properties
10:08:17,963 - DEBUG org.apache.struts.action.RequestProcessor -   No errors
detected, accepting input

Does anyone see what's wrong?

Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University PA Information Resources Management

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message