Techiio-author
Started by Chris GillNov 5, 2021

Open
When returning VO as json, how to return excluding null value?

0 VIEWES 0 LIKES 0 DISLIKES SHARE
0 LIKES 0 DISLIKES 0 VIEWES SHARE

When returning vo as JSON, how to go back except the null price?

@RequestMapping("/rbtInfo.do")
     public RobotVO rbtInfo(@RequestParam String rbtId){
         String rbtPower = "ON";
         robot.setRbtPower(rbtPower);
         return robot;
     }

Above is my controller.

And the return value is as follows.

{
     "rbtId": null,
     "rbtPower": "ON",
     "rtspAddr": null,
     "ifrRtspAddr": null,
     "stationPosition": null,
}

In this example, I want to go back simplest power for which the cost exists, but not the relaxation.

0 Replies

You must be Logged in to reply
Techiio-logo

Techiio is on the journey to build an ocean of technical knowledge, scouring the emerging stars in process and proffering them to the corporate world.

Follow us on:

Subscribe to get latest updates

You can unsubscribe anytime from getting updates from us
Developed and maintained by Wikiance
Developed and maintained by Wikiance