Problem validating dynamic Form with Validator-Framework
Hi, I've gfot problems with the validation Framework. (Struts 1.1b) If i try to validate a DynaValidatorForm I get the following error: java.lang.NullPointerException at org.apache.struts.action.DynaActionForm.getDynaProperty(DynaActionForm.java:539) at org.apache.struts.action.DynaActionForm.set(DynaActionForm.java:357) at org.apache.struts.action.DynaActionForm.reset(DynaActionForm.java:158) at org.apache.struts.validator.DynaValidatorForm.reset(DynaValidatorForm.java:357) at org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:618) at org.apache.struts.action.RequestProcessor.processActionForm(RequestProcessor.java:349) at de.neusta.j2ee.struts.NeustaRequestProcessor.process(Unknown Source) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1109) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:452) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1012) at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107) at java.lang.Thread.run(Thread.java:484) My struts-config (extracts): form-bean name=createStandortForm type=org.apache.struts.validator.DynaValidatorActionFormform-property name=name type=java.lang.String initial= /form-property name=street type=java.lang.String initial= /form-property name=city type=java.lang.String initial= /form-property name=zipCode type=java.lang.String initial= /form-property name=description type=java.lang.String initial= /form-property name=phone type=java.lang.String initial= /form-property name=fax type=java.lang.String initial= /form-property name=mobile type=java.lang.String initial= /form-property name=locType type=java.lang.String initial= //form-bean/form-beans action path=/StandortErzeugen name=createStandortForm scope=session validate=true input=/StandortErzeugen type=de.neusta.fortuna.webapp.standort.CreateStandortAction forward name=success path=/Standort/StandortErzeugen.jsp / forward name=created path=/StandortVerwaltung.do / /action plug-in className=org.apache.struts.validator.ValidatorPlugIn set-property property=pathnamevalue=/WEB-INF/validator-rules.xml/ set-property property=pathname value=/WEB-INF/validator.xml/ /plug-in/struts-config
Re: Problem validating dynamic Form with Validator-Framework
Depending on which version of Struts you are using, you might need to set the dynamic attribute to true like this: form-bean dynamic=true name=createStandortForm type=org.apache.struts.validator.DynaValidatorActionForm !-- Form Property stuff here -- /form-bean I can't remember off the top of my head whether you needed to do this for the DynaValidatorActionForm. I know that this has been changed so the framework can now induce whether the class in the type attribute is a subclass of DynaActionForm, but it hasn't always been that way. If you using the latest nightly and this problem still happens, then this is probably not it. If you are using an older version of 1.1b (maybe a couple of weeks old), then try adding this attribute or getting the latest version. HTH, Chuck -- Sent via jApache.org -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Problem validating dynamic Form with Validator-Framework
That's it! It's got to be! Yes - you must always specify dynamic=true for these dynamic forms! :-) Bleh - please post things in a nicer format next time you have to post things. Some of us are spoiled to well-formatted configs and just can't read jumbled up messes very well. [EMAIL PROTECTED] wrote: Depending on which version of Struts you are using, you might need to set the dynamic attribute to true like this: form-bean dynamic=true name=createStandortForm type=org.apache.struts.validator.DynaValidatorActionForm !-- Form Property stuff here -- /form-bean I can't remember off the top of my head whether you needed to do this for the DynaValidatorActionForm. I know that this has been changed so the framework can now induce whether the class in the type attribute is a subclass of DynaActionForm, but it hasn't always been that way. If you using the latest nightly and this problem still happens, then this is probably not it. If you are using an older version of 1.1b (maybe a couple of weeks old), then try adding this attribute or getting the latest version. HTH, Chuck -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]