struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alireza Fattahi <afatt...@yahoo.com.INVALID>
Subject Json result
Date Sat, 30 Aug 2014 09:05:34 GMT
Hi,

Conisider this action:

SampleAction{privateList<SampleVO>samples;//With setters and gettersprivateList<AnotherVO>anotherList;//With
setters and gettersprivateStringanString;//With setters and getters@Action(value ="/loadSelect",results
={@Result(name ="success",type ="json")})publicStringloadSomeSamples(){samples =newArrayList<SampleVO>();//Put
some object in samples.returnSUCCESS;}}
This will result to:

{"samples":{"0":{"property":"a"},"1":{"property":"b"},"2":{"property":"c"}},"anString":"hello","anotherList":{"0":{"prop1":"a","prop2":"b"},"1":{"prop1":"c","prop2":"d"}}}
Is it possible to configure json result to make below result

{"samples":{"0":{"property":"a"},"1":{"property":"b"},"2":{"property":"c"}}}

~Regards,
~~Alireza Fattahi
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message