<strong>storing and keeping a collection in a form bean across multiple submissions</strong>
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Cezar_Balaita
Posted On:   Thursday, March 14, 2002 11:15 PM

I'm including a collection (to populate a select list) into a BeanForm and on the jsp page I use an tag to try and maintain the collection intact in case an error in one of html's form elements pops up. The hidden element will look like this in the page source: However, on resubmission, I'm receiving the following error: java.lang.IllegalArgumentException: argument type mismatch at java.lang.reflect.Method.invoke(Native Method) at org.apache.struts.util.PropertyUtils.setSimpleProperty(PropertyUtils.java:988) The form setter expects a List as an argument. Is the PropertyUtils smart enough to convert the [String1, String2] element into a list   More>>

I'm including a collection (to populate a select list) into a BeanForm and on the jsp page I use an
tag to try and maintain the collection intact in case an error in one of html's form elements pops up. The hidden element will look like this in the page source:

However, on resubmission, I'm receiving the following error:


java.lang.IllegalArgumentException: argument type mismatch
at java.lang.reflect.Method.invoke(Native Method)
at org.apache.struts.util.PropertyUtils.setSimpleProperty(PropertyUtils.java:988)


The form setter expects a List as an argument.


Is the PropertyUtils smart enough to convert the [String1, String2] element into a list ? I think it gets confused when trying to pass the html hidden element to the form method setList(List list) . Anybody knows a way around this ? The scope is set to "request".


Thank you and keep strutsting...

   <<Less
About | Sitemap | Contact