Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

validation.xml NullPointerException

 
Whitney Albrecht
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone help me find my mistake? I have a form with three fields (username, password, and encryptedPassword).

To start off with I am just trying to make sure the userName field is filled in.

In my struts-config.xml:
<form-bean
name="authenticate"
type="org.apache.stuts.validator.DynaValidatorForm">
<form-propery name="userName" type="java.lang.String"/>
<form-propery name="password" type="java.lang.String"/>
<form-propery name="encryptPassword" type="java.lang.String"/>
</form-bean>
...
<plug-in className="org.apache.stuts.validator.ValidatorPlugin">
<set-property
property="pathnames"
value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
</plugin>

***

validation.xml:

<form name="authenticate">
<field property="userName" depends="required">
<arg0 key="authenticate.userName"/>
</field>
</form>
***

in applicationResorces.properties:
authenticate.userName=User Name
errors.required={0} is required.
****

When I deploy the project I get the following error:
[ValidatorPlugin] Loading validation rules from '/WEB-INF/validation.xml'
ERROR [ValidatorPlugin] java.lang.NullPointerException
at org.apache.commons.validator.ValidatorResources.internalProcessForms (ValidatorResources.java:464)
at org.apache.commons.validator.ValidatorResources.process(ValidatorResources.java:415)
at org.apache.commons.validator.ValidatorResources.<init>(ValidatorResources.java:162)
...

I am using struts 1.2.4 and JBoss.

Anyone have any ideas what I am missing or misstyping?

Thanks in advance.
[ July 26, 2005: Message edited by: Whitney Albrecht ]
 
Cendy Nguvy
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

In tag form-bean, replace form-propery by form-property.
 
Whitney Albrecht
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Doh!

Thanks for seeing what I couldn't.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic