Spring JSON request body not mapped to Java POJO

前端 未结 5 985
终归单人心
终归单人心 2020-12-29 04:54

I\'m using Spring to implement a RESTful web service. One of the endpoints takes in a JSON string as request body and I wish to map it to a POJO. However, it seems right now

5条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2020-12-29 05:40

    So it turned out that, the value of request body is not passed in because I need to have the @RequestBody annotation not only in my interface, but in the actual method implementation. Once I have that, the problem is solved.

提交回复
热议问题