search

Home  >  Q&A  >  body text

java后台得到list数据,list里面包含对象数据,怎么转换成json数据格式?

java得到的list:[Goods [id=60, name=123123], Goods [id=61, name=123123]]
怎么转化成json数据格式。
例如这样:[{id: 60, name: '123'}, {id: 40, name: '123'}];

PHP中文网PHP中文网2827 days ago289

reply all(3)I'll reply

  • PHP中文网

    PHP中文网2017-04-17 17:40:55

    fastjson

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-17 17:40:55

    fastjson is a good choice

    reply
    0
  • 高洛峰

    高洛峰2017-04-17 17:40:55

    This is the download address of the package (login required): http://download.csdn.net/download/t_worm...;
    Initialization: String jsonString = JSON.toJSONString(list); #🎜 🎜#Friends in need can try it out.

    reply
    0
  • Cancelreply