首页天道酬勤list对象转json字符串,将对象转化为json字符串

list对象转json字符串,将对象转化为json字符串

张世龙 05-05 22:25 44次浏览

publicresponsesearch _ update (requestbodyjsonobjecthotelroompriceget ) throwsexception ) stringhotelrooompricegetstr=hotell string obj=JSON object.getstring (' obj ); //obj为hotelRoomPriceGet对象匹配格式listhotelroompricegethotelroompricegets=JSON.parse array (URL decoder.decode ) obj ' utf首先从jsonObject中检索字符串类型的字符串,然后使用JSON.parseArray方法将其转换为list,但list中疯狂的是自己想要的包类

@ request mapping (updateorderofnew ) publicresponseupdateorderofnew ) requestbodyjsonobjectupdateorderlist ) throwsexcest long string price=JSON object.getstring (' price ); string room _ count=JSON object.getstring (room _ count ); string check _ in _ time=JSON object.getstring (' check _ in _ time ' ); string check _ out _ time=JSON object.getstring (' check _ out _ time ' ); stringnightc=JSON object.getstring (' nightc ); int state=JSON object.get intvalue (state ); string remark _ one=JSON object.getstring (remark _ one ); stringorderofcaigouonelist5=JSON object.getstring (orderofcaigouonelist ); //obj为OrderOfCaigouone对象匹配格式listorderofcaigouoneorderofcaigouonelist4=JSON.parse array (URL decoder.decode (URL

java对象转map,java字符串转json格式