Hi,

the +ADw-jsp:setProperty /+AD4- tag sets the beans properties using bean setter
method. But setting an empty string doesn't help.

Imagine you have a form with one text field:

+ADw-form action+AD0AIg-this.jsp+ACI- method+AD0AIg-post+ACIAPg-
+ADw-input type+AD0AIg-text+ACI- name+AD0AIg-foo+ACI- value+AD0AIgA8ACUAPQ- 
+myBean.getText() +ACUAPgAiAD4-
+ADw-/form+AD4-

And the myBean.text property is set in every page load through:

+ADw-jsp:useBean id+AD0AIg-myBean+ACI- class+AD0AIg-TestBean+ACI- 
+scope+AD0AIg-request+ACI- /+AD4-
+ADw-jsp:setProperty name+AD0AIg-myBean+ACI- property+AD0AIgAqACI- /+AD4-

If you fill in the form and submit it, it will contain the value you have
entered. But if you submit empty string, the value will not be changed. It
will be ignored.

This is very bad behaviour, because user cannot delete values, they can only
change them to another values.

Is it possible to instruct the bean setter not to ignore empty strings? What
would you recommend to do here?

I am using Tomcat 4.0.3 bound to IIS on Windows 2000.

Petr Tomasek

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to