struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eddie Bush <ekb...@swbell.net>
Subject Re: Problem validating dynamic Form with Validator-Framework
Date Wed, 31 Jul 2002 17:00:34 GMT
I don't see any problem with what you're doing - at least not right off. 
 I don't use DynaValidatorActionForm though - just DynaValidatorForm. 
 Maybe try updating to a recent nightly and see if you have the same 
problem.  If you feel you are unclear on how to use the validator 
framework you may check out Chuck's book on theserverside.com (don't 
forget to pre-order a copy too!) - and don't forget there is also an 
example WAR file included with Struts.

If you still can't get it going, repost again with your config ... in a 
more (human) readable form :-)  I don't see any errors in it, from what 
I can tell though ...

Regards,

Eddie

Axel Stahlhut wrote:

>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.DynaValidatorActionForm"><form-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="pathname"value="/WEB-INF/validator-rules.xml"/>        <set-property property="pathname"
value="/WEB-INF/validator.xml"/>      </plug-in></struts-config>
>
>Validator-rules.xml:
>
><validation-rules><validator name="required"         classname="org.apache.struts.validator.util.StrutsValidator"
        method="validateRequired"         methodParams="java.lang.Object, org.apache.commons.validator.ValidatorAction,
        org.apache.commons.validator.Field,         org.apache.struts.action.ActionErrors,
        javax.servlet.http.HttpServletRequest"         msg="errors.required">    </validator>
>   <validator name="mask"         classname="org.apache.struts.validator.util.StrutsValidatorUtil"
        method="validateMask"         depends="required"         msg="errors.invalid">
   </validator></validation-rules>
>validator.xml:
><form-validation><formset><form name="createStandortForm"><fieldproperty="name"depends="required"><arg0
key="error.required"/></field></form></formset></form-validation>
>Please help... Getting crazy on that since two days.
>
>Axel
>
>



--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message