I am wondering how spring split each parameters of a http request. By example i have this method definition :
@RequestMapping(value = "/search.do", method = RequestMethod.GET)
public String searchGet(ModelMap model,
@RequestParam(value = "memberId", required = false) Integer memberId,
@RequestParam(value = "member", required = false) String member) {...}
and i use this url :
/search.do?member=T&O=
i get member = T and not member =T&O=
The request params are limited to only memberId and member. Can i configure spring for solving this problem ?
Some characters in URLs have a special meaning. If they are supposed to be part of a value they need to be escaped.
If your value is T&O= then it needs to be changed to T%26O%3D
Looking at your controller code, your URL should have been
/search.do?memberId=T&member=
Then request parameter names will get mapped correctly.
If you wish to use same URL as mentioned in your question, change controller code to :
public String searchGet(ModelMap model,
@RequestParam(value = "O", required = false) Integer memberId,
@RequestParam(value = "member", required = false) String member) {...}
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