Hello, Thanks a lot...
...but in fact, i'd like to set to null the parameters whose values are explicitly empty strings (and not all of them) : i've got more than one form to set the properties of my bean, and they all call the same jsp page to process the <jsp:setProperty name="myBean" property="*"/> instruction... ...and i don't want to clear the properties which aren't linked to the validated form... I could write a JSP page for each form I use, but it would be really nice to know how to process the "set" method on an empty parameter... Olivier -----Message d'origine----- De : Sebastien BASTARD [mailto:[EMAIL PROTECTED]] Envoye : mardi 12 mars 2002 12:28 A : [EMAIL PROTECTED] Objet : Rep. : [JSP/JAVABEANS] set method and empty parameters... Hello, You can execute a method such as 'prepareParam' which set all variables to null of your JavaBean. Thus, you have, as default, null to your variables. Example : <jsp:setProperty name="myBean" property="prepareParam"/> <jsp:setProperty name="myBean" property="*"/> void setPrepareParam() { v1=null; v2=null; etc ... } Seb >>> [EMAIL PROTECTED] 12/03 12h19 >>> Hi all, I send some values of a html form (using post method) to a JSP page, which calls a JavaBean to actualize its properties (<jsp:setProperty name="myBean" property="*"/>). But when a field of the form is null (empty string in the form), the "set" method of the bean is not executed. Ex : in the form, the value of the field "toto" is changed from "aaa" to null : the setToto method of the bean is not called, and the value of the toto property is not actualized... A solution would really be appreciate :-) Many thanks, Olivier -- To unsubscribe: <mailto:[EMAIL PROTECTED]> For additional commands: <mailto:[EMAIL PROTECTED]> Troubles with the list: <mailto:[EMAIL PROTECTED]> -- To unsubscribe: <mailto:[EMAIL PROTECTED]> For additional commands: <mailto:[EMAIL PROTECTED]> Troubles with the list: <mailto:[EMAIL PROTECTED]> -- To unsubscribe: <mailto:[EMAIL PROTECTED]> For additional commands: <mailto:[EMAIL PROTECTED]> Troubles with the list: <mailto:[EMAIL PROTECTED]>
