Thanks Shane but that didn't work. I found out what is causing the problem though. Apparently the DynaActionFormClass is null. Since the method to set this is package private, I don't know how to get to it. Is there a way to get a new instance of a DynaForm without having to assign it to an action?
-Tim -----Original Message----- From: Bailey, Shane C. [mailto:[EMAIL PROTECTED] Sent: Thursday, May 29, 2003 1:57 PM To: 'Struts Users Mailing List' Subject: RE: creating new DynaValidatorForm Did you have: Public AssociateForm() { super(); } -----Original Message----- From: Chen, Gin [mailto:[EMAIL PROTECTED] Sent: Thursday, May 29, 2003 2:00 PM To: 'Struts Users Mailing List' Subject: RE: creating new DynaValidatorForm I get the following when I try to get a property from the form. ie associate.get("associateId") java.lang.NullPointerException at org.apache.struts.action.DynaActionForm.toString(DynaActionForm.java:511) Funny thing is that on the javadoc it says: java.lang.IllegalArgumentException - if there is no property of the specified name java.lang.NullPointerException - if the type specified for the property is invalid So looks like the property was picked up okay but the type is invalid?? I dont see how that could be as I have everything declared as Strings. <form-bean name="associateForm" type="com.nielsenmedia.nam.ui.form.AssociateForm"> <form-property name="associateId" type="java.lang.String" initial=""/> <form-property name="dmzId" type="java.lang.String" initial=""/> <form-property name="firstName" type="java.lang.String" initial=""/> <form-property name="middleName" type="java.lang.String" initial=""/> <form-property name="lastName" type="java.lang.String" initial=""/> <form-property name="businessEntityId" type="java.lang.String" initial=""/> <form-property name="productID" type="java.lang.String" initial=""/> <form-property name="productFlag" type="java.lang.String" initial="N"/> <form-property name="notificationFlag" type="java.lang.String" initial="N"/> <form-property name="statusInd" type="java.lang.String" initial=""/> </form-bean> Btw, my class is defined as such: public class AssociateForm extends DynaValidatorForm Did you find a way around your problem? -Tim -----Original Message----- From: Wendy Smoak [mailto:[EMAIL PROTECTED] Sent: Thursday, May 29, 2003 1:42 PM To: 'Struts Users Mailing List' Subject: RE: creating new DynaValidatorForm Gin Chen wrote: > I have a dynaValidatorForm that is linked to a class that I defined. > I'm trying to create a new instance of it as such: > AssociateForm associate = new AssociateForm(); > associate.initialize(aMapping); > Unfortunately it doesn't seem to be picking up the form properties. > I know this way of creating a new form works fine for > ActionForms. Is there a way to do this for a DynaForm? I had a similar problem and had not changed the 'extends' clause of the class in question. But what do you mean by not picking up the form properties? Dynamic forms don't have the traditional get/set methods, they have a Map instead. -- Wendy Smoak Applications Systems Analyst, Sr. Arizona State University PA Information Resources Management --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

