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 1FBCB9E25 for ; Wed, 22 May 2013 05:35:23 +0000 (UTC) Received: (qmail 85853 invoked by uid 500); 22 May 2013 05:35:22 -0000 Delivered-To: apmail-struts-issues-archive@struts.apache.org Received: (qmail 84934 invoked by uid 500); 22 May 2013 05:35:21 -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 84015 invoked by uid 99); 22 May 2013 05:35:21 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 May 2013 05:35:21 +0000 Date: Wed, 22 May 2013 05:35:20 +0000 (UTC) From: "Lukasz Lenart (JIRA)" To: issues@struts.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (WW-4066) Submitting form with parameters using brackets while devMode=true yields StringIndexOutOfBoundsException 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-4066?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13663795#comment-13663795 ] Lukasz Lenart edited comment on WW-4066 at 5/22/13 5:34 AM: ------------------------------------------------------------ Your code below is trying to localise already localised message and as the message contains {{[]}}, {{LocalizedTextUtil}} is trying to parse them. Before there was no such exception and was no problem in {{LocalizedTextUtil}} - that's me thoughts :-) {code:java} @Override public void addActionMessage(String message) { super.addActionMessage(getText(message)); } {code} was (Author: lukaszlenart): Your code below is trying to localise already localised message and as the message contains {{[]}}, {{LocalizedTextUtil}} is trying to parse them. Before there was no such exception and was no problem in {{LocalizedTextUtil}} - that's me thoughts :-0 {code:java} @Override public void addActionMessage(String message) { super.addActionMessage(getText(message)); } {code} > Submitting form with parameters using brackets while devMode=true yields StringIndexOutOfBoundsException > -------------------------------------------------------------------------------------------------------- > > Key: WW-4066 > URL: https://issues.apache.org/jira/browse/WW-4066 > Project: Struts 2 > Issue Type: Bug > Components: Core Actions > Affects Versions: 2.3.14 > Reporter: Chris Cranford > Assignee: Lukasz Lenart > Fix For: 2.3.15 > > Attachments: testcase.zip > > > Our BaseAction which extends ActionSupport overrides the addActionMessage() with the following: > {code:java} > @Override > public void addActionMessage(String message) { > super.addActionMessage(getText(message)); > } > {code} > With the above method in place during devMode=true, the following error stack trace occurs: > {noformat} > java.lang.StringIndexOutOfBoundsException: String index out of range: -1 > at java.lang.String.substring(String.java:1871) > at com.opensymphony.xwork2.util.LocalizedTextUtil.findText(LocalizedTextUtil.java:426) > at com.opensymphony.xwork2.util.LocalizedTextUtil.findText(LocalizedTextUtil.java:362) > at com.opensymphony.xwork2.TextProviderSupport.getText(TextProviderSupport.java:208) > at com.opensymphony.xwork2.TextProviderSupport.getText(TextProviderSupport.java:123) > at com.opensymphony.xwork2.ActionSupport.getText(ActionSupport.java:103) > at com.setech.dw.common.web.BaseAction.addActionMessage(BaseAction.java:209) > at com.opensymphony.xwork2.interceptor.ParametersInterceptor.setParameters(ParametersInterceptor.java:337) > at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:241) > {noformat} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira