Could not find acceptable representation

Write a controller method. The return type is jsonObject, or other object results will report an error

Could not find acceptable representation

原因是因为少了  将 对象 转为 json 格式的数据的包。




Solution

1. Can import missing packages.

2. Change the return type to string type. Convert the object to a json object and return a json string. It will not affect the use of the front end

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324995679&siteId=291194637