Java 如何在struts2中只返回array而不是json对象 专员信息\[\d+\]\.fname, 专员信息\[\d+\]\.指定, 专员信息\[\d+\]\.路径位置
以上代码给出了结果:Java 如何在struts2中只返回array而不是json对象 专员信息\[\d+\]\.fname, 专员信息\[\d+\]\.指定, 专员信息\[\d+\]\.路径位置,java,json,struts2,struts2-json-plugin,struts-action,Java,Json,Struts2,Struts2 Json Plugin,Struts Action,以上代码给出了结果: {"commissioner_info":[{"designation":"IG1","fname":"BS Bassi ","pathlocation":"http:\/\/103.231.125.106\/nesos\/imagerepresentatives\/151021104556Bhim.jpg"}]} 但我只需要数组而不是json对象,比如 [{"designation":"IG1","fname":"BS Bassi ","pathlocation":
{"commissioner_info":[{"designation":"IG1","fname":"BS Bassi ","pathlocation":"http:\/\/103.231.125.106\/nesos\/imagerepresentatives\/151021104556Bhim.jpg"}]}
但我只需要数组而不是json对象,比如
[{"designation":"IG1","fname":"BS Bassi ","pathlocation":"http:\/\/103.231.125.106\/nesos\/imagerepresentatives\/151021104556Bhim.jpg"}]
您需要将要序列化的对象指定为:
专员信息
否则,整个操作将被序列化