Bom dia, eu criei um webservice Rest usando a spring 4, mas a resposta na tela aparece falsa e vazia. Alguém poderia me dizer por quê?
Segue o código:
@RestController public class Controller {
@RequestMapping(value = "/info/{param1}/{param2}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) public List<JSONObject> search (@PathVariable(value = "param1") String param1, @PathVariable(value = "param2") Long param, final HttpServletRequest request) throws IOException, SQLException, DaoException, ForbiddenException { JSONObject json1 = new JSONObject(); JSONObject json2 = new JSONObject();; List<JSONObject> jsonList = new ArrayList<JSONObject>(); for(int i=0; i<=5; i++){ json1.put("JSON1", myrequest1); json2.put("JSON2", myrequest2); jsonList.add(json1); jsonList.add(json2); } return jsonList; >>>>>>Here json appears filled in correctly }
No postman
[
{
“empty”: false
},
{
“empty”: false
},
{
“empty”: false
},
{
“empty”: false
},
{
“empty”: false
},
{
“empty”: false
}
]
Alguém?