【发布时间】:2015-10-29 20:59:57
【问题描述】:
我正在使用带有 JSON 的 http Post 请求来获取对我的 web 服务的请求。 我的问题是我希望 JSON 参数不区分大小写,以便用户可以输入大写或小写的参数。
有什么方法可以实现这一点,而不是像这个链接一样对所有参数使用不同的设置器 Case insensitive JSON to POJO mapping without changing the POJO
这是我的示例 pojo:
public class SamplePojo implements Serializable
{
String name;
String mobileNo;
String address;
}
这是我的网络服务
@RequestMapping(value = "/send",
method = RequestMethod.POST,
consumes = MediaType.APPLICATION_JSON_VALUE)
public @ResponseBody String trackSMSPost (@RequestBody SamplePojo sample)
{
process(sample);
return "true";
}
即使参数名称都是大写或小写或驼峰式,是否有办法获取对 web 服务的请求。
【问题讨论】:
标签: java json web-services