Hi all, I solved my problem!!!! ...reading the documentation!!!! At page http://struts.apache.org/userGuide/building_view.html at section "3.3.5 The Struts Validator" I read: [...] Note: If your required form property is one of the Java object representations of primitive types (ie. java.lang.Integer), you must set the ActionServlet's convertNull init. parameter to true. Failing to do this will result in the required validation not being performed on that field because it will default to 0. [...]
So I followed the note and I modified my web.xml in this way: <servlet> <servlet-name>action</servlet-name> <servlet-class>org.apache.struts.action.ActionServlet</servlet-class> <init-param> <param-name>convertNull</param-name> <param-value>true</param-value> </init-param> ... </servlet> And all works fine!!!!! It was so simple! Sorry for my worthless question :( Bye, aris ----- Original Message ----- From: "aris" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, December 09, 2004 6:48 PM Subject: Problem with validation (?) > Hi all, > > I've a strange behaviour with my application and I suppose the reason is the > ValidatorPlugIn. > > I've an html form with an hidden field and the pre-population lets its > value="" (this is right because the value of the field in the associated > ValidatorForm is null). > When I submit the form, after the validation process I have value="0" (the > field is an Integer) but I haven't set validation rules on this field :| > > In my opinion the validator plugin uses a default value read somewhere to > fill the value of the hidden field (but I didn't set anything !?!) > > Can anyone help me? > > Thanks, > aris > > > > --------------------------------------------------------------------- > 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]