spring boot - how to avoid “Failed to instantiate [java.util.List]: Specified class is an interface” in HTTP controller handler?

后端 未结 2 1045
鱼传尺愫
鱼传尺愫 2021-02-19 02:28

In my spring boot REST API application, I need to handle HTTP POST by accepting a strongly-typed list as my input:

@RestController
public class CusttableControll         


        
2条回答
  •  既然无缘
    2021-02-19 02:45

    Try to add RequestBody annotation to your method definition

    @RequestMapping(value="/custtable/update", method=RequestMethod.POST)
    @ResponseBody
    public String updateCusttableRecords(@RequestBody List customers) {
        //Method body 
    }
    

提交回复
热议问题