I hava a jQuery ajax call like this:
var arr = ["a", "b", "c"];
$.get("/test", {testArray: arr}, function(data) {
alert(data);
});
server side:
@RequestMapping(value = "/test", method = RequestMethod.GET)
public String addAnotherAppointment(
HttpServletRequest request,
HttpServletResponse response,
@RequestParam("arr") arr,
Model model,
BindingResult errors) {
}
So how do I receive the parameter?
Thanks.
If you use spring 3.0++,use “@ResponseBody” annotation.
Do you want to send a json request, and receive a response from json?
If so, you’ll change your code like this.
server side:
create your own “Arr” class.
and