spring boot 2.* 参数接收

Posted vip95595

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了spring boot 2.* 参数接收相关的知识,希望对你有一定的参考价值。

测试环境:spring boot 2.1.0
/*
//数组和参数同时传递需要借助实体类实现
//接收json
@RequestMapping(value = "test3",method = RequestMethod.POST)
public String test3(@RequestBody String obj){
System.out.println(obj);
return "1";
}
//接收数组
@RequestMapping(value = "test2",method = RequestMethod.POST)
public String test2(String[] obj){
System.out.println(obj);
return "1";
}
//接收指定参数
@RequestMapping(value = "test1",method = RequestMethod.POST)
public String test1(String id){
System.out.println(id);
return "1";
}*/




















以上是关于spring boot 2.* 参数接收的主要内容,如果未能解决你的问题,请参考以下文章