Return-Path: X-Original-To: apmail-struts-issues-archive@minotaur.apache.org Delivered-To: apmail-struts-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 89D3A18AF2 for ; Fri, 4 Mar 2016 17:06:41 +0000 (UTC) Received: (qmail 48794 invoked by uid 500); 4 Mar 2016 17:06:41 -0000 Delivered-To: apmail-struts-issues-archive@struts.apache.org Received: (qmail 48743 invoked by uid 500); 4 Mar 2016 17:06:41 -0000 Mailing-List: contact issues-help@struts.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@struts.apache.org Delivered-To: mailing list issues@struts.apache.org Received: (qmail 48721 invoked by uid 99); 4 Mar 2016 17:06:41 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Mar 2016 17:06:41 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 221732C1F58 for ; Fri, 4 Mar 2016 17:06:41 +0000 (UTC) Date: Fri, 4 Mar 2016 17:06:41 +0000 (UTC) From: "Lukasz Lenart (JIRA)" To: issues@struts.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (WW-4176) Struts2 JSON Plugin: Send Map with Strings as Key to JSON Action is ignored, Numeric Keys will work and mapped MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/WW-4176?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15176097#comment-15176097 ] Lukasz Lenart edited comment on WW-4176 at 3/4/16 5:05 PM: ----------------------------------------------------------- This issue could be fixed by this issue WW-4560 was (Author: victorsosa): This issue could be fixed by this issue 4560 > Struts2 JSON Plugin: Send Map with Strings as Key to JSON Action is ignored, Numeric Keys will work and mapped > -------------------------------------------------------------------------------------------------------------- > > Key: WW-4176 > URL: https://issues.apache.org/jira/browse/WW-4176 > Project: Struts 2 > Issue Type: Bug > Components: Plugin - JSON > Affects Versions: 2.3.14.3 > Environment: Tomcat6, Struts 2.3.14.3,JSON Plugin 2.3.14.3,jquery > Reporter: Stefan Abendroth > Assignee: Lukasz Lenart > Fix For: 2.5 > > Attachments: WW-4176-proposal.patch > > > Sending Map from javascript/jsp to JSON Action, when the Keys are numeric everything works, when the keys are Strings then these entries are thrown away while the mapping process in the JSON Action takes place. > Important note: If i create a map in the JSON Action and send it to the client everything is ok. > alert which shows the Server generated JSON: > {noformat} > ServerJSON{"1":"1","2":"ANOTHERVALUE","ANOTHERKEY":"1","KEY":"VALUE"} > {noformat} > If i look into the sended data from javascript side in Eclipse i see in debug mode: > {noformat} > this=>myJSONMap:{2=[Ljava.lang.String;@3caf7a1f, 23=[Ljava.lang.String;@247aa859} > {noformat} > Alert shows on client side: > {noformat} > ClientJSON{"2":["ANOTHERVALUE"],"23":["1"]} > {noformat} > Hope it's clear where the problem is. Bug or misunderstood anything? > Would like to have a List of keys,values where the keys can be String/Long/Int and the values can be String/Long/int. > The direction Server generated Map=>JSON is ok, sending the same from client side will lose the entries with a String key. > Further i tried also to specify my Map like > {code:java} > private Map propertyValueMap = new LinkedHashMap(); > {code} > and set the getters/setters but don't work either. > Here is a part of my code: > JSP PAGE: > {code:html} >
> testForm1 >
>