aspose file tools*
The moose likes Java in General and the fly likes Help generating JSON data - I am using FlexJSON lib Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Help generating JSON data - I am using FlexJSON lib" Watch "Help generating JSON data - I am using FlexJSON lib" New topic
Author

Help generating JSON data - I am using FlexJSON lib

André Asantos
Ranch Hand

Joined: Nov 23, 2009
Posts: 234
I don't know why that generates the following JSON return below:


That shoud generate the following below:


regards,
André AS
André Asantos
Ranch Hand

Joined: Nov 23, 2009
Posts: 234
Java Code:
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14269
    
  21

I don't know the FlexJSON library, but I'd expect that the way the JSON looks will be determined from the structure of the object that you are converting to JSON.

What is the object pessoaImagemGaleria - what does its class look like?

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
André Asantos
Ranch Hand

Joined: Nov 23, 2009
Posts: 234
Hello Jasper, thanks for helping me...

That object has lists (four) and some attributes (also four).
André Asantos
Ranch Hand

Joined: Nov 23, 2009
Posts: 234
Jasper,
let me tell a new, I've got to return a right JSON format data now , but not 100% right, let me explain:

That shows:


However that should show this bellow:


I imagine that happens because that object has lists, but why?
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14269
    
  21

Can you show the source code of the class of pessoaImagemGaleria? Or just an outline of what member variables it has?

Looking at the JSON, I would guess that it looks like this:


If you want the second kind of output, it should be something like this:
André Asantos
Ranch Hand

Joined: Nov 23, 2009
Posts: 234
Hey Jasper, thanks a lot for helping me out.

That's working now your clue helped me a lot.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14269
    
  21

Good!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Help generating JSON data - I am using FlexJSON lib