aspose file tools*
The moose likes Struts and the fly likes validation.xml NullPointerException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "validation.xml NullPointerException" Watch "validation.xml NullPointerException" New topic
Author

validation.xml NullPointerException

Whitney Albrecht
Greenhorn

Joined: May 09, 2005
Posts: 19
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

Joined: May 25, 2005
Posts: 37
Hi,

In tag form-bean, replace form-propery by form-property.
Whitney Albrecht
Greenhorn

Joined: May 09, 2005
Posts: 19
Doh!

Thanks for seeing what I couldn't.
 
 
subject: validation.xml NullPointerException