• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts2, How to populate this object with json

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
reply
    Bookmark Topic Watch Topic
  • New Topic