You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Alvarado, Juan (c)" <Ju...@NielsenMedia.com> on 2002/12/10 17:32:10 UTC
RE: DynaActionForm problem -> IllegalArgumentException: No bean
specified
I don't believe DynaActionForm supports java.util.Collection.
Please correct me if I'm wrong.
Thanks
-----Original Message-----
From: Jerome Jacobsen [mailto:jerome.jacobsen@gentootech.com]
Sent: Tuesday, December 10, 2002 11:27 AM
To: Struts User
Subject: DynaActionForm problem -> IllegalArgumentException: No bean
specified
Oh Struts masters,
I get an exception when Struts populates my DynaActionForm from request
parameters. With DEBUG logging on I see the following:
INFO org.apache.struts.action.RequestProcessor - Processing a 'POST' for
path '/changeLocale' DEBUG org.apache.struts.util.RequestUtils - Looking
for ActionForm bean instance in scope 'session' under attribute key
'localeForm' DEBUG org.apache.struts.util.RequestUtils - Recycling
existing DynaActionForm instance of type 'localeForm' DEBUG
org.apache.struts.util.RequestUtils - -->
DynaActionForm[dynaClass=localeForm,locales={en_US,es_MX},selectedLocale=en_
US] DEBUG org.apache.struts.action.RequestProcessor - Storing ActionForm
bean instance in scope 'session' under attribute key 'localeForm' DEBUG
org.apache.struts.action.RequestProcessor - Populating bean properties
from this request DEBUG org.apache.commons.beanutils.BeanUtils -
BeanUtils.populate(DynaActionForm[dynaClass=localeForm,locales=<NULL>,select
edLocale=<NULL>], {selectedLocale.localeString=[Ljava.lang.String;@d0})
DEBUG org.apache.commons.beanutils.BeanUtils -
setProperty(DynaActionForm[dynaClass=localeForm,locales=<NULL>,selectedLocal
e=<NULL>], selectedLocale.localeString, [es_MX]) DEBUG
org.apache.commons.beanutils.BeanUtils - Target bean = null DEBUG
org.apache.commons.beanutils.BeanUtils - Target name = localeString
Looks like RequestUtils is getting the correct DynaActionForm from the
session (logs 2,3,4). But then I don't understand why the BeanUtils logs
show the properties to be NULL (logs 7,8,9).
My DynaActionForm contains two properties. One is a JavaBean and the other
is a Collection of JavaBeans.
<form-bean name="localeForm" type="org.apache.struts.action.DynaActionForm"
dynamic="true">
<form-property name="selectedLocale" type="com.blah.LocaleBean"/>
<form-property name="locales" type="java.util.Collection"/>
</form-bean>
The element type of property locales is also com.blah.LocaleBean.
com.blah.LocaleBean is very simple. It contains only one property called
localeString which is a java.lang.String.
Am I doing something wrong???
Environment:
Struts 1.1b2
BeanUtils 1.5 (also tried 1.3)
Tomcat 4.0.6
--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>