java - How to get the data list as JSON String -
inner lists not return json string.. first data list return...
is there way data json string ?
------my method ---------------------
@requestmapping(value="/mainreservationchart", method = requestmethod.get) public modelandview getmrchartdata(@modelattribute ("reservationsummaryrqdto") reservationsummaryrqdto search){ reservationsummarydto returndatadto = new reservationsummarydto(); mainreservationchartwsimpl wsimpl = mrwsutil.getinstance().getws_serviceport(); search.sethotelcode("bbh"); search.setreportdate(toxmldategmt(new date())); returndatadto = wsimpl.getreservationsummary(search); map<string, object> model = new hashmap<string, object>(); model.put("status", true); model.put("hotelcode", returndatadto.gethotelcode()); model.put("summary", returndatadto.getsummarymonth()); model.put("data", returndatadto); return new modelandview("jsonview", model); }
dtos
@xmlaccessortype(xmlaccesstype.field) @xmltype(name = "reservationsummarydto", proporder = { "hotelcode", "summarymonth" }) public class reservationsummarydto { protected string hotelcode; @xmlelement(nillable = true) protected list<summarymonthdto> summarymonth; }
@xmlaccessortype(xmlaccesstype.field) @xmltype(name = "summarymonthdto", proporder = { "month", "summarytype" }) public class summarymonthdto { protected string month; @xmlelement(nillable = false) protected list<summarytypedto> summarytype; }
@xmlaccessortype(xmlaccesstype.field) @xmltype(name = "summarytypedto", proporder = { "date", "displaysequence", "total", "typecode" }) public class summarytypedto { @xmlelement(nillable = true) protected list<summarydatedto> date; protected integer displaysequence; protected double total; protected string typecode;
try this
@requestmapping(value="/mainreservationchart", method = requestmethod.get, headers = "accept=application/json")
Comments
Post a Comment