This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I am relatively new to Struts and Spring, but I thought I had this worked out logically, but it's not working.
I have a Select Statement that populates based on a bean -- it works fine. It shows the select box with the values selected based on the value of the bean. Hoever when I attempt to submit the form I am getting a type mismatch in the ActionForm.
problemStatementClassificationReferenceArray is a java Set<ClassificationReference>, obviously ClassificationReference is a java class with several attributes including'id' and 'title'. It populates fine, but when I submit it fails with:
java.lang.IllegalArgumentException: Cannot invoke mil.af.igems.ui.web.finding.FindingForm.setProblemStatementClassificationReferenceArray - argument type mismatch
My question is does the Select statement not return based on the type of the 'property' attribute? Is it returning something else, like a String Array?
In Action, you can retrieve the value selected in the drop down,
so the property provided should be string..
Property should be declared as follows,
Hope this give you an idea to work further.. !
Joined: Feb 22, 2012
Thanks for the reply! I seem to be a little confused on something. You can use an object of type 'Collection' in the property attribute of a select statement, which is used to identify the selected items (in this case it is a multiple), but when it comes back from making selection changes, you are returning a String object, so your property attribute needs to reference a String? That seems to defeat the purpose of being able to use a Collection object for the select statement. I feel like I am missing something simple.
I'll read your link and maybe that will help.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com