Reputation: 35689
may i know is it possible to annotate one method with 2 post and get ?
@RequestMapping(value = "/testonly",
method = RequestMethod.GET, RequestMethod.POST)
public String getSomething(){
}
Upvotes: 3
Views: 6371
Reputation: 1
It shouldn't supposed to pass method type as both GET and POST. It will throw unexpected exception if we pass both GET and POST.
Regards, Raja Sekhar.
Upvotes: 0
Reputation: 1500893
The method
field is an array, so I'd expect this to work:
@RequestMapping(value = "/testonly",
method = { RequestMethod.GET, RequestMethod.POST })
Upvotes: 24