Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-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 B3152D1FB for ; Wed, 15 Aug 2012 14:52:38 +0000 (UTC) Received: (qmail 30257 invoked by uid 500); 15 Aug 2012 14:52:38 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 30160 invoked by uid 500); 15 Aug 2012 14:52:38 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 30152 invoked by uid 99); 15 Aug 2012 14:52:38 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Aug 2012 14:52:38 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id F2A3C2C5BE0 for ; Wed, 15 Aug 2012 14:52:37 +0000 (UTC) Date: Thu, 16 Aug 2012 01:52:37 +1100 (NCT) From: "Kyle Braak (JIRA)" To: issues@commons.apache.org Message-ID: <16669027.13866.1345042357994.JavaMail.jiratomcat@arcas> In-Reply-To: <1572224473.13845.1345041998018.JavaMail.jiratomcat@arcas> Subject: [jira] [Updated] (OGNL-221) Map with String key that contains a non-word character prevents value from being saved 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/OGNL-221?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Kyle Braak updated OGNL-221: ---------------------------- Description: I have written a very simple Action, and freemaker template so that you can replicate my problem. My Action is as follows: ---------- public class TestAction extends BaseAction { private Map tmap = new TreeMap(); @Override public void prepare() throws Exception { super.prepare(); tmap.put("Animalia", ""); tmap.put("Ani_malia", ""); tmap.put("Ani:malia", ""); tmap.put("Ani-malia", ""); tmap.put("Ani%malia", ""); tmap.put("Ani+malia", ""); } @Override public String execute() { return SUCCESS; } public Map getTmap() { return tmap; } } ---------- It prepares a TreeMap with some entries having only a String key, and an empty String value. The following freemarker template displays the keys, and allows the user to save a new value for each one: ----------
<#list tmap?keys as k>
Key Value
${k}
<@s.submit name="save"/>
---------- Unfortunately, after entering new values for each key and submitting the form, the only keys that have values successfully saved are: Animalia Ani_malia The following keys do NOT have values successfully saved: Ani:malia Ani-malia Ani%malia Ani+malia Indeed the presence of such non-word characters breaks the OGNL parsing of the Map's String key. To be sure no unwanted interception is occurring, I am using the most basic struts.xml configuration: ---------- /WEB-INF/pages/portal/test.ftl ---------- Thank you very much for any help you can offer. With kind regards was: I have written a very simple Action, and freemaker template so that you can replicate my problem. My Action is as follows: {code:title=TestAction.java|borderStyle=solid} public class TestAction extends BaseAction { private Map tmap = new TreeMap(); @Override public void prepare() throws Exception { super.prepare(); tmap.put("Animalia", ""); tmap.put("Ani_malia", ""); tmap.put("Ani:malia", ""); tmap.put("Ani-malia", ""); tmap.put("Ani%malia", ""); tmap.put("Ani+malia", ""); } @Override public String execute() { return SUCCESS; } public Map getTmap() { return tmap; } } {code} It prepares a TreeMap with some entries having only a String key, and an empty String value. The following freemarker template displays the keys, and allows the user to save a new value for each one: {code:title=test.ftl|borderStyle=solid}
<#list tmap?keys as k>
Key Value
${k}
<@s.submit name="save"/>
{code} Unfortunately, after entering new values for each key and submitting the form, the only keys that have values successfully saved are: Animalia Ani_malia The following keys do NOT have values successfully saved: Ani:malia Ani-malia Ani%malia Ani+malia Indeed the presence of such non-word characters breaks the OGNL parsing of the Map's String key. To be sure no unwanted interception is occurring, I am using the most basic struts.xml configuration: {code:xml} /WEB-INF/pages/portal/test.ftl {code} Thank you very much for any help you can offer. With kind regards > Map with String key that contains a non-word character prevents value from being saved > -------------------------------------------------------------------------------------- > > Key: OGNL-221 > URL: https://issues.apache.org/jira/browse/OGNL-221 > Project: Commons OGNL > Issue Type: Bug > Environment: struts2 version 2.2.1 - which uses OGNL 3.0 > freemarker version 2.3.19 > Reporter: Kyle Braak > > I have written a very simple Action, and freemaker template so that you can replicate my problem. > My Action is as follows: > ---------- > public class TestAction extends BaseAction { > private Map tmap = new TreeMap(); > @Override > public void prepare() throws Exception { > super.prepare(); > tmap.put("Animalia", ""); > tmap.put("Ani_malia", ""); > tmap.put("Ani:malia", ""); > tmap.put("Ani-malia", ""); > tmap.put("Ani%malia", ""); > tmap.put("Ani+malia", ""); > } > @Override > public String execute() { > return SUCCESS; > } > public Map getTmap() { > return tmap; > } > } > ---------- > It prepares a TreeMap with some entries having only a String key, and an empty String value. > The following freemarker template displays the keys, and allows the user to save a new value for each one: > ---------- >
> > > > > > <#list tmap?keys as k> > > > > > >
KeyValue
${k}
>
> <@s.submit name="save"/> >
>
> ---------- > Unfortunately, after entering new values for each key and submitting the form, the only keys that have values successfully saved are: > Animalia > Ani_malia > The following keys do NOT have values successfully saved: > Ani:malia > Ani-malia > Ani%malia > Ani+malia > Indeed the presence of such non-word characters breaks the OGNL parsing of the Map's String key. > To be sure no unwanted interception is occurring, I am using the most basic struts.xml configuration: > ---------- > > "http://struts.apache.org/dtds/struts-2.0.dtd"> > > > > > > > /WEB-INF/pages/portal/test.ftl > > > > ---------- > Thank you very much for any help you can offer. > With kind regards -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira