-
Sep 10th, 2010, 10:49 AM
#1
Spring 3 - Restful - passing ArrayList<object> to the controller
Hi,
I am using RESTful web service to make a call to my controller and I need to pass in an ArrayList<Product> that's been populated in a hidden field the jsp.
@RequestMapping(value = "/find", method = POST)
public ModelAndView displayMyProductsXXX(@RequestParam("products") ArrayList productList) throws IOException {
.
.
.
}
I tried @ModelAttribute and it didn't work. So far the @RequestParam ("products") ArrayList productList returns a list of products but the type is String instead of Product
Can anyone please help me to find out the best way to implement this?
Thanks
-
Sep 11th, 2010, 07:58 AM
#2
Have you setup a custom converter to convert the string into your Product object.
Here is a article that will explain what you need.
-
Sep 22nd, 2010, 09:51 PM
#3
@MartyJones
Hi, sorry for the late reply. Yes I have the converter, but unable to receive a parameter in a form of list or array from the jsp.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules