Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts2, How to populate this object with json

 
Moli molina
Greenhorn
Posts: 19
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have this question:

How to populate this object from a struts2 action. My action populates without any problem a lot of my objects, but I have a restriction on a JSON input. My input is like this:

I don't now how to populate...The class geometry can have a double[] or double[][] or double[][][] because the JSON input can have multiple geometry types. Json examples:



And my object is this:



If I modify my geometry class to double[] coordinates...it works, but only with point geometry...

I use struts2 2.1.8 with json plugin.

Many thanks
 
Moli molina
Greenhorn
Posts: 19
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi at all,

Anybody has idea how to solve this question?

My object to populate has type object, and I think taht JSON parser don't have idea to parse this...Can a do an interceptor to parse this propety first?

Any suggestion?


Many thanks!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic