Re: Struts2 REST plugin: Passing array in JSON

2012-10-11 Thread Shaun Lim
Hi Chris, It's just: Method public java.lang.String org.apache.commons.lang.exception.NestableRuntimeException.getMessage(int) threw an exception when invoked on net.sf.json.JSONException: Error while setting property=arrayListStr type interface java.util.List The program crapped out in JsonLibH

Re: Struts2 REST plugin: Passing array in JSON

2012-10-11 Thread Chris Pratt
I was more looking for the output of all the System.out.println's (*Chris*) On Oct 11, 2012 12:40 PM, "Shaun Lim" wrote: > By the way, mapping to a simple String[] works, but I'm finding it hard to > believe that the plugin does not know how to handle conversions to List.. > > On Thu, Oct 11, 2

Re: Struts2 REST plugin: Passing array in JSON

2012-10-11 Thread Lukasz Lenart
2012/10/11 Shaun Lim : > By the way, mapping to a simple String[] works, but I'm finding it hard to > believe that the plugin does not know how to handle conversions to List.. Could you prepare a full Maven base example ? Thanks in advance -- Ɓukasz + 48 606 323 122 http://www.lenart.org.pl/ -

Re: Struts2 REST plugin: Passing array in JSON

2012-10-11 Thread Shaun Lim
By the way, mapping to a simple String[] works, but I'm finding it hard to believe that the plugin does not know how to handle conversions to List.. On Thu, Oct 11, 2012 at 11:54 AM, Shaun Lim wrote: > Method public java.lang.String > org.apache.commons.lang.exception.NestableRuntimeException.ge

Re: Struts2 REST plugin: Passing array in JSON

2012-10-11 Thread Shaun Lim
Method public java.lang.String org.apache.commons.lang.exception.NestableRuntimeException.getMessage(int) threw an exception when invoked on net.sf.json.JSONException: Error while setting property=arrayListStr type interface java.util.List On Thu, Oct 11, 2012 at 11:19 AM, Chris Pratt wrote: > W

Re: Struts2 REST plugin: Passing array in JSON

2012-10-11 Thread Chris Pratt
What's the output of the run with this class & JSON? (*Chris*) On Thu, Oct 11, 2012 at 10:52 AM, Shaun Lim wrote: > Hi Chris, > > I did start off with a List implementation but started changing > stuff around in futile attempts to get something working. Anyway I tried > your suggestion, and am

Re: Struts2 REST plugin: Passing array in JSON

2012-10-11 Thread Shaun Lim
Hi Chris, I did start off with a List implementation but started changing stuff around in futile attempts to get something working. Anyway I tried your suggestion, and am still getting the same error: //I've a whole bunch of different fields here cause i was testing various things, but "arrayList

Re: Struts2 REST plugin: Passing array in JSON

2012-10-10 Thread Chris Pratt
You *might* need to initialize the countries array. I wouldn't be surprised if internally the JSON library is doing a getCountries().add("CA") and throwing a null pointer exception because getCountries is returning a null. Also, you should really be programming to interfaces, not implementations.

Struts2 REST plugin: Passing array in JSON

2012-10-10 Thread Shaun Lim
My entity class: import java.util.ArrayList; public class Test { private String name; private String description; private ArrayList countries; public Test() { } public String getName() { return name; } public void setName(String name) { this.na