I was just wondering how to pass in post parameters such as following exercept from html options, normally i would get a array in language such as php (POST['param'][0]...
would work i believe)
url?param=value1¶m=value2¶m=value3
I tried:
@RequestMapping(value="/schedule", method = RequestMethod.POST) public void action(String[] param)
But this doesn't work for some reason...
Any ideas would be greatly appreciated!
You can use this:
@RequestMapping(value="/schedule", method = RequestMethod.POST) public void action(@RequestParam(value = "param[]") String[] paramValues){...}
it will retrieve all values (inside array paramValues
) of parameter param
(note the attribute value
of RequestParam
: it ends with []
)
This should work:
@RequestMapping(value="/schedule", method = RequestMethod.POST) public void action(@RequestParam("param") String[] param)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With