tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glenn Nielsen <gl...@voyager.apg.more.net>
Subject Jasper JspRuntimeLibrary.java jspSetproperty with value="" does not set the property
Date Sat, 22 Jul 2000 04:19:49 GMT
While playing around with some JSP beans & custom tags I tried to do the following...

<jsp:setProperty name="somename" property="someproperty" value=""/>

and the value didn't get changed.
I traced it down to the code below in Jaspers JspRuntimeLibrary.introspecthelper()

I couldn't find anything to say that an empty string is not a valid value
in the JSP 1.1 spec.  If it is not valid, then the above setProperty should
cause a ParseException to be thrown.  Not ignore it.

I think an empty string should be valid, and the below '|| value.equals("")'
removed.

Unless anyone has strong objections to this, I'll make the change and then
submit my first commit. :-)

                } else {                
                    //XXX please check. 
                    if(value == null || value.equals("")) return;
                    Object oval = convert(value, type);
                    if ( oval != null ) 
                        method.invoke(bean, new Object[] { oval });
                }

Regards,

Glenn

----------------------------------------------------------------------
Glenn Nielsen             glenn@more.net | /* Spelin donut madder    |
MOREnet System Programming               |  * if iz ina coment.      |
Missouri Research and Education Network  |  */                       |
----------------------------------------------------------------------

Mime
View raw message