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 Re: Jasper JspRuntimeLibrary.java jspSetproperty with value="" does not set the property
Date Sat, 22 Jul 2000 04:52:42 GMT
The syntax for jsp:setProperty 'property' explicitely states that
if a parameter has a value of "", the corresponding property is
not set.  But the syntax for 'value' does not.  From my reading
of the specs this means that a "" value is valid as long as
the property is not being set from a parameter.

Glenn

Pierre Delisle wrote:
> 
> Glenn,
> 
> Have a look at the following thread:
> 
>     http://archives.real-time.com/rte-tomcat/2000/Jul/msg01674.html
> 
> I have not yet seen a definitive answer on this on the list though.
> Eduardo?
> 
>     -- Pierre
> 
> Glenn Nielsen wrote:
> >
> > 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  |  */                       |
> > ----------------------------------------------------------------------
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org

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

Mime
View raw message