spring 注解 @ResponseBody 返回 JSON 能不能设置他不返回为 null 的值
java@RequestMapping(value="/{username}",method=RequestMethod.GET,params="json") @ResponseBody public User show(@PathVariable String username) { return users.get(username); }
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
可以在页面显示的时候使用三目,读取如果是null就输出空字符