PDA

View Full Version : Help generating JSON data - I am using FlexJSON lib



andredecotia
13 Dec 2010, 4:49 AM
I don't know why that generates the following JSON return below:


{"rows":
{
"chave":[valorNumerico],
"chave":["valorString"]
}
}

That shoud generate the following below:

{"rows":
[
{
"idsDosThumbs":"185",
"chave":"valorNumerico",
"chave":"valorString"
}
]
}

Java Code:


private String returnJSON;
private String json;
//get e set

//serialização dos dados em JSON
JSONSerializer serializer = new JSONSerializer();
json = serializer.exclude("pessoaInfo", "*.class", "imagem", "idPessoaImagem", "fotoPrincipal")
.rootName("linhas")
.deepSerialize(pessoaImagemGaleria);
setReturnJSON(json);


regards,
André AS

Screamy
13 Dec 2010, 7:33 AM
You might want to do some reading, starting here: http://flexjson.sourceforge.net/

Scroll down the page a bit and you'll find lots of helpful info, with code samples.