Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    String becomes array of single character strings

    I'm using the following code to send a simple string parameter on a DSRequest. The "groupLevel" variable is a string with the value "style".
    Code:
    Map<String, String> extras = new HashMap<String, String>();
    extras.put("GroupLevel", groupLevel);
    req.setParams(extras);
    However, when I look at the request on the developer console I can see that is has been broken into an array or map of single character strings, with a mysterious integer showing up in the last array element.
    Code:
    "params":{
            "GroupLevel":{
                "0":"s", 
                "1":"t", 
                "2":"y", 
                "3":"l", 
                "4":"e", 
                "tI":2
            }
    I remember seeing this sort of thing before and I think it was a bug in core GWT, but I can't find my previous post and can't remember what the trick was to "fix" it.
    Last edited by jay.l.fisher; 23 Oct 2010, 14:21.

    #2
    Here's the GWT issue. Please star it if you haven't already done so.

    The workaround it to cast the string object to String rather than calling toString() on it.

    Sanjiv

    Comment


      #3
      Hi,

      i had the same problem, solved by using (String)something.getValue(), instead of something.getValue().toString()

      Comment

      Working...
      X