Sto facendo un semplice 'get' in JBoss/Spring. Voglio che il client mi passi una matrice di numeri interi nell'URL. Come posso configurarlo sul server? E mostrare il client dovrebbe inviare il messaggio?Passaggio di una matrice o elenco a @Pathvariable - Spring/Java
Questo è quello che ho adesso.
@RequestMapping(value="/test/{firstNameIds}", method=RequestMethod.GET)
@ResponseBody
public String test(@PathVariable List<Integer> firstNameIds)
{
//What do I do??
return "Dummy";
}
Sul client vorrei passare qualcosa come
http://localhost:8080/public/test/[1,3,4,50]
Quando ho fatto che ho un errore:
java.lang.IllegalStateException: Could not find @PathVariable [firstNameIds] in @RequestMapping
Si potrebbe è necessario utilizzare New Spring 3 UI Field Formatting http://static.springsource.org/spring/docs/3.0.0.RC1/reference/html/ch05s06.html –