Additionally i don't get the exception when i remove sizes and colours from the form, as i was getting mystical bean utils errors I started doing split half debugging like one does with javascript.

Everything's fine except for these properties. As I said before I've had this working in this way, there just must be something that i'm missed (although I'm fecked if i can see it).

My guess us that the exception happens when struts creates a dynabean from my action form, and/or attempts to populate the form based on the information it gets about the bean. But my types match as far as i can see.

The only thing i thought it could have been was stuff being stored as objects in the arraylist, I've had this working for weeks with arraylists.

I've updated beanutils in case that was the issue and googled for other folks with the same problem . to no avail.

On 13 Jan 2004, at 18:06, Mark Lowe wrote:


Hi Richard


Here are the summarized bits


public ArrayList getColours() { return colourList; }

public void setColours(ArrayList colourList) {
        this.colourList = colourList;
}

//

ProductForm theForm = (ProductForm) form;

theForm.setColours(colourList);
...

<html:select property="colours" multiple="true">
        <html:options collection="colours" property="foo" />
</html:select>


Everything works (the select menus select the correct values etc, but then when i submit i get the bean utils illegal argument exception.


This worked pretty much in the same way before. Hopefully I'm just missing something simple.

here are my mappings also.

Cheers mark

<action path="/admin/product/view" type="com.boxstuff.shop.admin.ViewProductAction" name="productEditForm" validate="false" scope="session" attribute="productEditForm">
<forward name="success" redirect="false" path="admin.product.view"/>
</action>
<action path="/admin/product/save" type="com.boxstuff.shop.admin.SaveProductAction" name="productEditForm" validate="false" scope="session" input="admin.product.view" attribute="productEditForm">
<forward name="success" path="admin.product.view" redirect="false"/>
</action>





<ProductForm.java> On 13 Jan 2004, at 17:31, Richard Hightower wrote:

I have an idea, but would like to see your html:form and ActionForm before I
ruin my reputation with a bad mojo answer.


Send them directly to me and copy this list.

Rick Hightower
Developer

Struts/J2EE training -- http://www.arc-mind.com/strutsCourse.htm

Struts/J2EE consulting --
http://www.arc-mind.com/consulting.htm#StrutsMentoring

-----Original Message-----
From: Mark Lowe [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 13, 2004 7:18 AM
To: Struts Users Mailing List
Subject: Bothersome BeanUtils.populate exception


beanUtils keeps getting its knickers in a twist when i submit a form with 2 select menus with multiple values. I've had this working before with the same version of struts and commons. Its not the action as the exception is thrown before i get that far, when i remove the menus the form submits fine.

I have form properties of type arrayList. I;d expect this exception if
i were to be using unsupported types but I've been setting the values
with  String and the form properties are also of type string.

I have trouble believing that bean utils has an issue with converting
Object to String when the values are copied.

The exception is a typical beanutils chocolate fire guard exception. If
i weren't using strings i'd understand but i am.


Any insights welcomed.

java.lang.IllegalArgumentException: argument type mismatch
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j av
a:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess or
Impl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(PropertyU ti
ls.java:1789)
at
org.apache.commons.beanutils.PropertyUtils.setNestedProperty(PropertyU ti
ls.java:1684)
at
org.apache.commons.beanutils.PropertyUtils.setProperty(PropertyUtils.j av
a:1713)
at
org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java: 1019)
at
org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808)



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


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


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


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



Reply via email to