I have a bean on a page, and the user may remove the value of an attribute by using the delete key to remove the contents of a pre-populated text box. On the following page we use <jsp:setProperty...property="*"> or <jsp:setProperty...property="firstName"> to set all the values. This works fine for everything apart from empty strings.
The approach I took to solving the same problem is to remove my session-scope bean and then re-instantiate it:
<% session.removeAttribute("sRefQueryTerms"); %> <jsp:useBean id="sRefQueryTerms" scope="session" class="org.mdibl.ctd.jsp.beans.RefQueryTermsBean" /> <jsp:setProperty name="sRefQueryTerms" property="*" />
I don't know how (in)efficient this is, but it didn't sound any worse than doing 15 setProperty calls setting strings to null (or "").
/mcr
=========================================================================== To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant archives, FAQs and Forums on JSPs can be found at:
http://java.sun.com/products/jsp http://archives.java.sun.com/jsp-interest.html http://forums.java.sun.com http://www.jspinsider.com