DWR returns list of empty objects

View: New views
4 Messages — Rating Filter:   Alert me  

DWR returns list of empty objects

by polvo () :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I'm using DWR to call a method that returns a Map<Integer, List<StringConfigurationProperties>>
in dwr.xml, i include the line:


    <convert converter="bean" match="###.###.core.domain.StringConfigurationProperties"/>



I also include a converter for List and ArrayList. I don't have one for Map, because i read that this is not necessary.


When I call this method, dwr.util.toDescriptiveString(map, 3)) displays the return object as:

stringConfigurations = {
  7:{
    empty:false
  },
  8:{
    empty:false
  },
  9:{
    empty:false
  },
  10:{
    empty:false
  },
  11:{
    empty:false
  },
  12:{
    empty:false
  },
  13:{
    empty:false
  },
  14:{
    empty:false
  }
}


here's the simple pojo for StringConfigurationProperties

public class StringConfigurationProperties {
        int m;
        int s;
        int n;
        int x;
        int o;
       
        /**
         * @param m
         * @param s
         * @param x
         * @param n
         * @param o
         */
        public StringConfigurationProperties(int m, int s, int n, int x, int o) {
                super();
                this.m = m;
                this.s = s;
                this.n = n;
                this.x = x;
                this.o = o;
        }

        /**
         *
         */
        public StringConfigurationProperties() {
                super();
        }
        [... plus all getters and setters]
}

Why is it not converting my StringConfigurationProperties???

Re: DWR returns list of empty objects

by polvo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Anyone have any idea what the problem is here? Why does the response appear to include an empty collection? And why is it that the only property that the collection has is "empty" with the value "false", as if to say the collection is not empty. It certainly seems empty.

Re: DWR returns list of empty objects

by polvo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Resolution: I changed the list to an array and now it works. Is this a bug in DWR?

polvo wrote:
Anyone have any idea what the problem is here? Why does the response appear to include an empty collection? And why is it that the only property that the collection has is "empty" with the value "false", as if to say the collection is not empty. It certainly seems empty.

Re: DWR returns list of empty objects

by polvo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Resolution: I changed the list to an array and now it works. Is this a bug in DWR?

polvo wrote:
Hello,

I'm using DWR to call a method that returns a Map<Integer, List<StringConfigurationProperties>>
in dwr.xml, i include the line:


    <convert converter="bean" match="###.###.core.domain.StringConfigurationProperties"/>



I also include a converter for List and ArrayList. I don't have one for Map, because i read that this is not necessary.


When I call this method, dwr.util.toDescriptiveString(map, 3)) displays the return object as:

stringConfigurations = {
  7:{
    empty:false
  },
  8:{
    empty:false
  },
  9:{
    empty:false
  },
  10:{
    empty:false
  },
  11:{
    empty:false
  },
  12:{
    empty:false
  },
  13:{
    empty:false
  },
  14:{
    empty:false
  }
}


here's the simple pojo for StringConfigurationProperties

public class StringConfigurationProperties {
        int m;
        int s;
        int n;
        int x;
        int o;
       
        /**
         * @param m
         * @param s
         * @param x
         * @param n
         * @param o
         */
        public StringConfigurationProperties(int m, int s, int n, int x, int o) {
                super();
                this.m = m;
                this.s = s;
                this.n = n;
                this.x = x;
                this.o = o;
        }

        /**
         *
         */
        public StringConfigurationProperties() {
                super();
        }
        [... plus all getters and setters]
}

Why is it not converting my StringConfigurationProperties???