You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Thierry Cools <tc...@billobox.com> on 2001/09/28 13:46:50 UTC
html:select multiple selection problem
Hi,
It seems that the multiple selection with the html:select tag doesn't work.
Documentation of struts says that if using a multiple selection the property must be an array type, however the request I send looks like
http://localhost:7001/billobox/archives.do?archiveSelection=2&sendDateSelection=&providers=1&providers=3&Filter=Filter
Has you can see I have 2 times a request parameter "providers" that comes from my multiple selection in the select.
afterward I receive the following exception :
java.lang.IllegalArgumentException: argument type mismatch
at java.lang.reflect.Method.invoke(Native Method)
at org.apache.struts.util.PropertyUtils.setSimpleProperty(PropertyUtils.java:992)
at org.apache.struts.util.PropertyUtils.setNestedProperty(PropertyUtils.java:904)
at org.apache.struts.util.PropertyUtils.setProperty(PropertyUtils.java:936)
at org.apache.struts.util.BeanUtils.populate(BeanUtils.java:518)
at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:772)
at org.apache.struts.action.ActionServlet.processPopulate(ActionServlet.java:2061)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1563)
at com.billobox.ebilling.client.common.InitializationServlet.process(InitializationServlet.java:48)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:491)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:263)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2390)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:1959)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
Struts is calling the "setSimpleProperty" that calls the "setProviders" method with a single value, which is normal due to the request parameters, but not for my form who's expecting an array.
Can someone help me with this problem, is that a bug in the 1.0 version, I tried to see if it was solved in a later version (the last nightly build) but it seems the sources for BeanUtils are no more available.
Thanks,
Thierry
Re: html:select multiple selection problem
Posted by Jonathan M Crater <jo...@fanniemae.com>.
bean utils is now part of the commons project. links to source code are
here:
http://jakarta.apache.org/commons/components.html
Thierry Cools wrote:
> Hi, It seems that the multiple selection with the html:select tag
> doesn't work. Documentation of struts says that if using a multiple
> selection the property must be an array type, however the request I
> send looks
> like http://localhost:7001/billobox/archives.do?archiveSelection=2&sendDateSelection=&providers=1&providers=3&Filter=Filter Has
> you can see I have 2 times a request parameter "providers" that comes
> from my multiple selection in the select. afterward I receive the
> following exception : java.lang.IllegalArgumentException: argument
> type mismatch
> at java.lang.reflect.Method.invoke(Native Method)
> at
> org.apache.struts.util.PropertyUtils.setSimpleProperty(PropertyUtils.java:992)
>
> at
> org.apache.struts.util.PropertyUtils.setNestedProperty(PropertyUtils.java:904)
>
> at
> org.apache.struts.util.PropertyUtils.setProperty(PropertyUtils.java:936)
>
> at
> org.apache.struts.util.BeanUtils.populate(BeanUtils.java:518)
> at
> org.apache.struts.util.RequestUtils.populate(RequestUtils.java:772)
> at
> org.apache.struts.action.ActionServlet.processPopulate(ActionServlet.java:2061)
>
> at
> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1563)
>
> at
> com.billobox.ebilling.client.common.InitializationServlet.process(InitializationServlet.java:48)
>
> at
> org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:491)
> at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
> at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:263)
>
> at
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
>
> at
> weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2390)
>
> at
> weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:1959)
>
> at
> weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
> at
> weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120) Struts is
> calling the "setSimpleProperty" that calls the "setProviders" method
> with a single value, which is normal due to the request parameters,
> but not for my form who's expecting an array. Can someone help me with
> this problem, is that a bug in the 1.0 version, I tried to see if it
> was solved in a later version (the last nightly build) but it seems
> the sources for BeanUtils are no more available. Thanks, Thierry
Re: html:select multiple selection problem solved
Posted by Thierry Cools <tc...@billobox.com>.
Problem solved,
it was just a problem in my ActionForm, I had a method "setProviders(int index, String provider)" in the class and Struts was taking this one in place of the "setProviders(String[] providers)" one.
----- Original Message -----
From: Thierry Cools
To: struts-user@jakarta.apache.org
Sent: Friday, September 28, 2001 1:46 PM
Subject: html:select multiple selection problem
Hi,
It seems that the multiple selection with the html:select tag doesn't work.
Documentation of struts says that if using a multiple selection the property must be an array type, however the request I send looks like
http://localhost:7001/billobox/archives.do?archiveSelection=2&sendDateSelection=&providers=1&providers=3&Filter=Filter
Has you can see I have 2 times a request parameter "providers" that comes from my multiple selection in the select.
afterward I receive the following exception :
java.lang.IllegalArgumentException: argument type mismatch
at java.lang.reflect.Method.invoke(Native Method)
at org.apache.struts.util.PropertyUtils.setSimpleProperty(PropertyUtils.java:992)
at org.apache.struts.util.PropertyUtils.setNestedProperty(PropertyUtils.java:904)
at org.apache.struts.util.PropertyUtils.setProperty(PropertyUtils.java:936)
at org.apache.struts.util.BeanUtils.populate(BeanUtils.java:518)
at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:772)
at org.apache.struts.action.ActionServlet.processPopulate(ActionServlet.java:2061)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1563)
at com.billobox.ebilling.client.common.InitializationServlet.process(InitializationServlet.java:48)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:491)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:263)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2390)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:1959)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
Struts is calling the "setSimpleProperty" that calls the "setProviders" method with a single value, which is normal due to the request parameters, but not for my form who's expecting an array.
Can someone help me with this problem, is that a bug in the 1.0 version, I tried to see if it was solved in a later version (the last nightly build) but it seems the sources for BeanUtils are no more available.
Thanks,
Thierry