@RequestParam consumes Both GET and POST Params

时间:2016-04-25 09:17:08

标签: java spring rest post get

This probably comes down to bad design and Implementation. But we're upgrading our Jersey to Spring based Servlets for our REST API's.

Now we've noticed that request which use both GET and POST (don't ask me why some people implemented it that way). Get Consumed as Array, or at least comma separated;

F/E if a Requests has a form param amount=5 and in the url ?amount=5. The @RequestParam String amount variable consumes the request as "5,5".

Is this intended behaviour? are there workaround like giving one of the options precedence?

0 个答案:

没有答案