I try to send a request in the Form:
list=Apple1&list=Apple2&list=Apple3
whereas Apple is a complex object which is serialized in JSON:
{"param1":"value1", "param2":"value2"}
I defined a Dispatcher Servlet in Spring to receive such requests, with a method like:
request(@RequestParam("list") POJO[] pojos){
//handle request
}
it is no problem to send a single POJO to such a method like
request(@RequestParam("single") POJO pojos){
//handle request
}
but as soon I try to transmit an Array Spring is dying with an Exception like:
java.lang.NoSuchMethodException: [Lmy.package.Apple;.<init>()
How can I teach the dispatcher servlet to deserialize arrays correctly? Thanks for you help
@RequestBodyand pass the request body as json