I am doing a simple 'get' in JBoss/Spring. I want the client to pass me an array of integers in the url. How do I set that up on the server? And show should the client send the message?
This is what I have right now.
@RequestMapping(value="/test/{firstNameIds}", method=RequestMethod.GET)
@ResponseBody
public String test(@PathVariable List<Integer> firstNameIds)
{
//What do I do??
return "Dummy";
}
On the client I would like to pass something like
http://localhost:8080/public/test/[1,3,4,50]
When I did that I get an error:
java.lang.IllegalStateException: Could not find @PathVariable [firstNameIds] in @RequestMapping
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…