Hi,

Thanks for the patch. But unfortunately, this would make jasper
non-spec compliant. The JSP 1.1 spec in section 2.13.2.1 states
that for the use of propertyName="*":

   If a parameter has a value of "", the corresponding property
   is not modified.

No exception is mentioned for properties set with type String.

I have also resolved bug 1207 as invalid for the same reason.

Cheers,
Larry

> -----Original Message-----
> From: Samuel Niles Peretz [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 05, 2001 10:22 AM
> To: [EMAIL PROTECTED]
> Subject: jasper bug
> 
> 
> org/apache/jasper/runtime/JspRuntimeLibrary.java
> in the method: introspecthelper
> This is a fix for the bug in handling jsp:setProperty for 
> text fields (as posted in
> previous bug reports such as 
> http://nagoya.apache.org/bugzilla/show_bug.cgi?id=1207)
> where set method of property is not invoked for blank text fields.
> 
> The fix is simply to add another condition in the if 
> statement that checks for a
> null or blank value.  The method should only return on a 
> blank value if the type of
> the property is something other than java.lang.String.  That 
> is, for a property of
> type java.lang.String, the method should invoke the set 
> method for that property
> even if the value is blank.
> 
> Here is the unified diff, with the original version first:
> 
> diff -ubB /tmp/saved/JspRuntimeLibrary.java
> /dev/main/jetty/src/org/apache/jasper/runtime/JspRuntimeLibrary.java
> --- /tmp/saved/JspRuntimeLibrary.java   Thu Apr 05 10:12:32 2001
> +++ 
> /dev/main/jetty/src/org/apache/jasper/runtime/JspRuntimeLibrar
> y.java        Thu
> Apr 05 10:17:18 2001
> @@ -194,7 +194,7 @@
>                          createTypedArray (bean, method, values, t);
>                      }
>                  } else {
> -                   if(value == null || (param != null && 
> value.equals(""))) return;
> +                   if(value == null || (param != null && 
> value.equals("") &&
> !type.getName().equals( "java.lang.String" ))) return;
> 
>                      Object oval = convert(value, type);
>                      if ( oval != null )
>                          method.invoke(bean, new Object[] { oval });
> 
> 

Reply via email to