I got a NullPointer when struts tried to read a HTML form with mapped
attributes

<html:text property="attributeValue(manuf_product_url)" size="20" />

The problem existed in 'BeanUtils.java' (+/- line 630):

        if (type.isArray() && (index < 0)) { // Scalar value into array

where type was null for a MappedPropertyDescriptor. I've added the
following code and now everything works fine:

            if (descriptor instanceof IndexedPropertyDescriptor) {
                type = ((IndexedPropertyDescriptor) descriptor).
                    getIndexedPropertyType();
+           } else if (descriptor instanceof MappedPropertyDescriptor) {
+               type = ((MappedPropertyDescriptor) descriptor).
+                       getMappedPropertyType();
            } else {
                type = descriptor.getPropertyType();
            }


Can this be checked in in the code, or did I miss something?

Mark

-- 
--o-o----------
Mark Kettner
http://www.fredhopper.com
Amsterdam, The Netherlands
Phone:  +31 20 3206203 Mobile: +31 620 609 817
fax:    +31 20 8848747
E-mail: [EMAIL PROTECTED], [EMAIL PROTECTED]



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to