You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Lukasz Lenart (JIRA)" <ji...@apache.org> on 2013/05/14 15:31:16 UTC

[jira] [Updated] (WW-4066) Submitting form with parameters using brackets while devMode=true yields StringIndexOutOfBoundsException

     [ https://issues.apache.org/jira/browse/WW-4066?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lukasz Lenart updated WW-4066:
------------------------------

    Description: 
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}

  was:
Our BaseAction which extends ActionSupport overrides the addActionMessage() with the following:

@Override
public void addActionMessage(String message) {
  super.addActionMessage(getText(message));
}

With the above method in place during devMode=true, the following error stack trace occurs:

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)


    
> 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
>
> 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