http://localhost:8080./list?product=car,apple
@RequestMapping(value="/list", method = RequestMethod.GET)
@ResponseBody
public String list( @RequestParam(required = false) String[] product){
return new Gson().toJson(product));
}
Okazuje się że parametrze dostaję listę 1 elementową z elementem car,apple a chciałbym dostać listę dwu elementową. Co robię nie tak ?
http://localhost:8080./list?product=car&product=apple //to działa ale wolałbym uniknąć takiego urla