tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Haraburda <>
Subject Problem with jsp:setProperty and blank strings
Date Tue, 18 Jul 2000 20:42:33 GMT

	I am having problems using the jsp:setProperty tag when I want to set a
parameter to a blank string.  It doesn't work.  I have traced this back
to org.apache.jasper.runtime.JspRuntimeLibrary.  For example, if I have
the following line of JSP:

<jsp:setProperty name="myBean" property="myProp" value=""/>

where myBean is a bean that I have instantiated with jsp:useBean, and
myProp is a String on myBean, with the appropriate getter and setter
methods.  I am collecting the values from a form, so I have also tested:

<jsp:setProperty name="myBean" property="*"/>


<jsp:setProperty name="myBean" property="myProp"/>

I don't know if this is a bug or a feature, but in, on line 152 in the introspect method you check
to see if the value is null OR an empty string.  If it is, you skip
calling introspecthelper which would call the appropriate setter
method.  Additionally, in introspecthelper, on line 200 of the same file
there is the same check.  Changing these to check only for null seems to
fix the problem.

Is this a bug?  If it is, I would be more than happy to submit a patch
(although the changes are trivial).  If not, why is setup to behave like
this, and what can I do to get the behavior I want?

Thanks for your time,


David Haraburda -
Outsourcing Center - Providing Insight Into Outsourcing
972-980-0013 x736

View raw message