[jira] [Commented] (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:comment-tabpanel=15900823#comment-15900823 ] Lukasz Lenart commented on WW-4066: --- hm... maybe we should add a logic to {{TextProvider}} to allow discover if the passed param is a key or a message ... > 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.16 > > Attachments: ParametersInterceptor.java, 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 was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (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:comment-tabpanelfocusedCommentId=13800661#comment-13800661 ] ASF subversion and git services commented on WW-4066: - Commit 1534156 from [~lukaszlenart] in branch 'struts2/trunk' [ https://svn.apache.org/r1534156 ] WW-4066 Solves problem with StringIndexOutOfBoundsException when message was already translated 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.16 Attachments: ParametersInterceptor.java, 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 was sent by Atlassian JIRA (v6.1#6144)
[jira] [Commented] (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:comment-tabpanelfocusedCommentId=13800668#comment-13800668 ] Johno Crawford commented on WW-4066: Are you able to give an ETA on 2.3.16 vote? 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.16 Attachments: ParametersInterceptor.java, 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 was sent by Atlassian JIRA (v6.1#6144)
[jira] [Commented] (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:comment-tabpanelfocusedCommentId=13800693#comment-13800693 ] Hudson commented on WW-4066: FAILURE: Integrated in Struts2-JDK6 #817 (See [https://builds.apache.org/job/Struts2-JDK6/817/]) WW-4066 Solves problem with StringIndexOutOfBoundsException when message was already translated (lukaszlenart: rev 1534156) * /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/ParametersInterceptor.java 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.16 Attachments: ParametersInterceptor.java, 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 was sent by Atlassian JIRA (v6.1#6144)
[jira] [Commented] (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:comment-tabpanelfocusedCommentId=13801494#comment-13801494 ] Lukasz Lenart commented on WW-4066: --- Around 8 issues left, I think within 2-4 weeks the Vote should be started 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.16 Attachments: ParametersInterceptor.java, 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 was sent by Atlassian JIRA (v6.1#6144)
[jira] [Commented] (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:comment-tabpanelfocusedCommentId=13799824#comment-13799824 ] Johno Crawford commented on WW-4066: Sure, our apps are built on the original behaviour that global rules from struts.xml would be enforced. This allows us to avoid exploits such as http://struts.apache.org/release/2.3.x/docs/s2-009.html as implementing ParameterNameAware for an action will ignore rules defined in the acceptParamNames param tag. Now to get back the original behaviour we are having to subclass ParametersInterceptor and copy massive chunks of code as there is no easy way to override SecurityMemberAccess. 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.16 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 was sent by Atlassian JIRA (v6.1#6144)
[jira] [Commented] (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:comment-tabpanelfocusedCommentId=13799924#comment-13799924 ] Lukasz Lenart commented on WW-4066: --- [~johno] I'm going to restore the original behaviour of {{ParametersInterceptor}} where parameter must be accepted by {{ParameterInterceptor}} AND ParameterNameAware - it was a mistake :\ 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.16 Attachments: ParametersInterceptor.java, 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 was sent by Atlassian JIRA (v6.1#6144)
[jira] [Commented] (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:comment-tabpanelfocusedCommentId=13799929#comment-13799929 ] Lukasz Lenart commented on WW-4066: --- [~crancran] I'm going to implement {{system}} TextProvider which will be separated from default TextProvider and will be used internally by Struts2 and will be safe - I mean no exception like that above. 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.16 Attachments: ParametersInterceptor.java, 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 was sent by Atlassian JIRA (v6.1#6144)
[jira] [Commented] (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:comment-tabpanelfocusedCommentId=13799285#comment-13799285 ] Lukasz Lenart commented on WW-4066: --- [~johno] do you have any more comment? 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.16 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 was sent by Atlassian JIRA (v6.1#6144)
[jira] [Commented] (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:comment-tabpanelfocusedCommentId=13668124#comment-13668124 ] Johan Ström commented on WW-4066: - Lukasz: Yes, the original error described in this ticket is not the same. Not sure I followed the changes in the comments correctly, but I thought it could be somewhat related at least.. :) To clarify; the setter, which exists, is NOT called in the above example. However, I just noticed that if I add 'param name=acceptParamNamessort,limit,offset/param' it works as expected, but if I just let acceptableParameterName() return true for the same values, the setter never gets called. I'm doing some more digging here, I'll get back with further information in a while. 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.16 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
[jira] [Commented] (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:comment-tabpanelfocusedCommentId=13668138#comment-13668138 ] Lukasz Lenart commented on WW-4066: --- [~jstrom] I was suspecting that ... and probably know where is the problem. Please fill an issue for that. 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.16 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
[jira] [Commented] (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:comment-tabpanelfocusedCommentId=13668142#comment-13668142 ] Johan Ström commented on WW-4066: - Found it. In ParametersInterceptor, the acceptParamNames config element is used in two places on each interception: * to fill up acceptableParameters. This is based on both acceptParamNames config, AND any ParameterNameAware's acceptableParameterName(Strings) method. * to setAcceptProperties on the MemberAccessValueStack. This ONLY uses the acceptParamNames config. My problem occurs if acceptParamNames config rejects a param, but acceptableParameterName(String) accepts it. The ParameterInterceptor will go try to set the value on the stack (since it was accepted by the ParameterNameAware), but the stack will reject it since setAcceptProperites is based on acceptParamNames only. Not sure what the proper fix here is, but at least it explains the problem I'm having. 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.16 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
[jira] [Commented] (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:comment-tabpanelfocusedCommentId=13668152#comment-13668152 ] Johan Ström commented on WW-4066: - [~lukaszlenart]: Ticked separately as WW-4083 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.16 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
[jira] [Commented] (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:comment-tabpanelfocusedCommentId=13668153#comment-13668153 ] Lukasz Lenart commented on WW-4066: --- Please register a new issue with your demo app - I will try to solve it asap 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.16 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
[jira] [Commented] (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:comment-tabpanelfocusedCommentId=13667624#comment-13667624 ] Lukasz Lenart commented on WW-4066: --- Just collecting what could potentially break backward compatibility: - silly change, just added {{e}} to have the full stacktrace (but for sure changed with wrong commit): http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/ParametersInterceptor.java?r1=1439410r2=1456961diff_format=h 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.16 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
[jira] [Commented] (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:comment-tabpanelfocusedCommentId=13667720#comment-13667720 ] Lukasz Lenart commented on WW-4066: --- [~johno] found the problem. {{devMode}} never worked in ParamatersInterceptor before ;-) Check that commit [1] (line 153-154), as you can see {{devMode}} field was static which means it was never set - you can check that starting in debug mode the example app and setting break point in line 319 (Struts 2.3.4.1). So, framework's behaviour didn't change at all, you just wasn't informed about that ;-) I have changed {{BaseAction}} and wrapped {{super.addActionError(getText(message));}} with {{try...catch}} block and in catch added {{super.addActionError(message);}} to keep the expected behaviour. Please forget about my ideas with dedicated interceptor ;-) [1] http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/interceptor/ParametersInterceptor.java?r1=1456961r2=1368841diff_format=h 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.16 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
[jira] [Commented] (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:comment-tabpanelfocusedCommentId=13667799#comment-13667799 ] Johan Ström commented on WW-4066: - Hi, I'd like to report that I have similar problems with 2.3.14.2. My action implements both ParameterAware and ParameterNameAware, and accepts a set of params via setters. With the WW-3973 change, this now allows setting of a lot of other parameters (if it is an acceptable name OR allowed by acceptableParameterName() it is let through). To avoid this and only really allow the ones I want, I tried this in the interceptor stack: {code} interceptor-ref name=params param name=acceptParamNamesThisIsNotARealParameter_BUT_It_must_be_set_to_work/param /interceptor-ref {code} If the value is blank the acceptParamNames are not even regarded, so I put a dummy value there.. This however results in failure to set even basic Strings: {quote} public void setSort(String sort) { } {quote} A simple call to ?simpleparam=abcsort=name results in this: {code} ERROR (com.opensymphony.xwork2.interceptor.ParametersInterceptor:38) - Developer Notification (set struts.devMode to false to disable this message): Unexpected Exception caught setting 'sort' on 'class com.myapp.MyActionClass: Error setting expression 'sort' with value ['name', ] Error setting expression 'sort' with value ['name', ] - [unknown location] {code} I do NOT get an error for the simpleparam, which is not OK'ed by the acceptableParamNames() method so that is not expected. But for the simple 'sort' parameter, it refuses to work.. If I remove the acceptParamNames setting, everything works as expected. 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.16 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
[jira] [Commented] (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:comment-tabpanelfocusedCommentId=13667828#comment-13667828 ] Lukasz Lenart commented on WW-4066: --- [~jstrom] in my opinion your case is a bit different, please take a look on WW-4068 and if this is not enough please register a new issue with sample Maven based app (preferable). The mentioned ERROR is visible just in DevMode and I think it should be lowered to WARN (as it is just a developer warn), but if you could prepare a demo app I can look into deeper. 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.16 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
[jira] [Commented] (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:comment-tabpanelfocusedCommentId=13667014#comment-13667014 ] Lukasz Lenart commented on WW-4066: --- WoW :-) Lots of reading ;-) I need a time to digest all your comments - anyway I would like to restore to original framework's behaviour in that case (except Developer Notification) as migration to the next minor version shouldn't break backward compatibility. 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.16 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
[jira] [Commented] (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:comment-tabpanelfocusedCommentId=13666377#comment-13666377 ] Lukasz Lenart commented on WW-4066: --- [~crancran] what's your opinion? What should I do? I'm going to postpone this issue and we can return to it in the future. 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
[jira] [Commented] (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:comment-tabpanelfocusedCommentId=13666479#comment-13666479 ] Chris Cranford commented on WW-4066: One of the reasons why our base action overrides the action errors, message, and field message methods was because it allowed us to simply call {{addActionMessage(some.message);}} without having to wrap the message itself using {{getText}}. That part is what has worked up until the latest builds. What I'll propose to our team is that we'll modify all actions to make use of the {{getText()}} call within each action where we pass a message to the methods that we were originally overriding and remove their overrides from the base action. That should bring the code base in line with the expectations and avoid the {{StringIndexOutOfBoundsException}} error. But what still troubles me with this is related to the developer notifications themselves. I modified the {{ItemSearchAction}} as follows: {code} public ItemSearchAction() { this.criteria = new ItemSearchCriteria(); } {code} Technically, that should instantiate the model prior to any method invocations on the action itself in a similar fashion as your interceptor proposal would insure the model is created before trying to set the parameters on the action. But unfortunately, when I display the action messages which resulted from the form submission to the action, I still get notifications that there were issues with all the form elements. Looking at the tags used in the form itself, the submit tag doesn't dictate any attributes as required. We typically use the key attribute so that it does the localization lookup for the value attribute. Using key also sets the name attribute of the tag but with the non-localization value. When using key='button.search', I end up with the following: {code}input type='submit' id='form_button_search' name='button.search' value='Search'{code} Following your developer notifications, that implies I need some object called 'button' inside the model with a property called 'search'. Is the use of the key attribute of a submit tag with a phrase that contains a '.' when the action implements the {{ModelDrivenT}} interface isn't possible without generating these warnings? It seems the only viable options here is either A) don't use a '.' in the key names, B) modify the model to contain the hierarchy so use of '.' is possible, or C) don't use the key attribute at all and simply use the value attribute where it contains: {code}value='%{getText('button.search')}'{code} What do you suggest? Lastly, I still can't seem to submit the values for the itemConditionTypes, itemNumberTypes, itemNumbers, and itemSearchTypes arrays without the developer notifications even when the model is instantiated upon the creation of the action itself. Are we sure that creating the model with your above proposed solution will 'fix' my test case? 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.16 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] [Commented] (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:comment-tabpanelfocusedCommentId=1330#comment-1330 ] Chris Cranford commented on WW-4066: bq. So I understand your point about needing to somehow alter the 'paramsPrepareParamsStack' but the default stack seems to work as intended. I'll have to check why we chose to use that particular interceptor stack rather than the default. In reviewing the struts-default XML configuration, I see specifically why we opted for the {{paramsPrepareParamsStack}}. It's been several years since we started the foundation on this application and so I had forgotten the reasons for my decision :). A majority of our existing {{ModelDrivenT}} actions inspect a set of submitted values and based on those values, determine how the model is to be instantiated. That was the real benefit of this particular interceptor stack for our application's design because it allowed us to set properties on the action for those specific submitted values, do whatever logic inside {{prepare()}} was necessary for the model's allocation, and then the second parameters interceptor invocation populated the model accordingly. The old way this interceptor stack worked with parameters had little assumptions since parameters could technically exist on the action, model, or a combination of both. I understand the reason to prompt the developer with a warning if the property doesn't exist on the action or the model, but if it exists on at least one of them, I don't believe a developer warning message makes sense in this use case. 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.16 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
[jira] [Commented] (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:comment-tabpanelfocusedCommentId=13666716#comment-13666716 ] Chris Cranford commented on WW-4066: In doing a bit more of my own testing, I found under 2.3.4.1 the {{OgnlException}} exceptions are thrown even during the first {{params}} portion of the {{paramsPrepareParamsStack}} as seen here: {code} WARNING: Error setting expression 'itemSearchTypes[3]' with value '[Ljava.lang.String;@63336706' ognl.OgnlException: target is null for setProperty(null, 3, [Ljava.lang.String;@63336706) {code} It appears then to me the only visible difference here is that no action messages were ever being generated and added to the action's message list for either case of the invocation of the {{params}} portion of the interceptor stack in the older builds; where-as in the later builds these exceptions are actually triggering developer warnings. Because these warnings included a '[' character, that is what provoked the {{getText()}} method to throw an exception with our original base action implementation. But I don't see how the {{ModelDrivenCreateAware}} interface solves the problem of where the property exists on the model but not the action, as seen in the demo application added. - First {{ParametersInterceptor}} call populates the action instance. - The {{ModelDrivenInterceptor}} simply pushes model from {{getModel}} onto the top of the stack - Second {{ParametersInterceptor}} call populates the model instance. If we alter this above functionality in anyway, would it not have a wider impact on those using that particular interceptor stack, right? 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.16 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
[jira] [Commented] (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:comment-tabpanelfocusedCommentId=13663795#comment-13663795 ] Lukasz Lenart commented on WW-4066: --- 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
[jira] [Commented] (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:comment-tabpanelfocusedCommentId=13663799#comment-13663799 ] Lukasz Lenart commented on WW-4066: --- My idea is still the same - create dedicated interceptor with connected interface to allow create model - something like: {code:java} public interface ModelDrivenCreateAware { void createModel(); } public class ModelDrivenCreateInterceptor { public String doIntercept(ActionInvocation ai) { if (ai.getAction() instanceof ModelDivenCreateAware) { (ModelDivenCreateAware(ai.getAction())).createModel(); } } } {code:java} which should be merged with ModelDriven at some point. 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
[jira] [Commented] (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:comment-tabpanelfocusedCommentId=13662035#comment-13662035 ] Chris Cranford commented on WW-4066: bq. If you take a look on paramsPrepareParamsStack you will spot that the params interceptor is listed two times - before and after prepare, but there is also modelDriven listed just before the second params which will put non-null Model onto stack. I don't recall specifically why the interceptor stack was designed that way beyond perhaps being backward compatible. I recall a discussion sometime back where it was decided that the interceptor stack would be designed this way. I just applied 2.3.4.1 to the sample application and with devMode=true, I do see where the OGNL exceptions are written to the logs, perhaps I had overlooked them prior. What boggles me however, is that StringIndexOutOfBoundsException isn't thrown as a side affect. And the stack trace related to that exception is coming from {{LocalizedTextUtil}}. Why is that just now surfacing but not in prior builds? 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
[jira] [Commented] (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:comment-tabpanelfocusedCommentId=13661617#comment-13661617 ] Lukasz Lenart commented on WW-4066: --- I have tested with the latest 2.3.15-SNAPSHOT version and the only problem I have spotted is related to {{search}} button and the presented warning is a desired behaviour in devMode - to allow developers simply find typos in setters / names of parameters eg. search and setSeaarch(String value). 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
[jira] [Commented] (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:comment-tabpanelfocusedCommentId=13661618#comment-13661618 ] Lukasz Lenart commented on WW-4066: --- I have added a note to the docs https://cwiki.apache.org/confluence/display/WW/Parameters+Interceptor#ParametersInterceptor-Warningonmissingparameters 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
[jira] [Commented] (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:comment-tabpanelfocusedCommentId=13661622#comment-13661622 ] Lukasz Lenart commented on WW-4066: --- To clarify - I removed {{interceptors/}} from your {{struts.xml}} - maybe we should double / move {{modelDriven}} interceptor before the {{params}} interceptor in {{paramsPrepareParamsStack}} 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
[jira] [Commented] (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:comment-tabpanelfocusedCommentId=13661624#comment-13661624 ] Lukasz Lenart commented on WW-4066: --- The problems lays in {{paramsPrepareParamsStack}} - it has to be updated to match changes in {{defaultStack}} 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
[jira] [Commented] (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:comment-tabpanelfocusedCommentId=13661625#comment-13661625 ] Chris Cranford commented on WW-4066: bq. I have tested with the latest 2.3.15-SNAPSHOT version and the only problem I have spotted is related to search button and the presented warning is a desired behaviour in devMode - to allow developers simply find typos in setters / names of parameters eg. search and setSeaarch(String value). In the case of search, we generally treat the key= portion of that struts2 tag like key=button.search. I haven't looked at the code prior to making this post, but if key=button.search translates to various values depending on the localization being used, wouldn't that mean I would have different setters per language? 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
[jira] [Commented] (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:comment-tabpanelfocusedCommentId=13661627#comment-13661627 ] Lukasz Lenart commented on WW-4066: --- The problem is related to {{prepare}} interceptor and {{modelDriven}} interceptor - first will call {{prepare()}} method which will create instance of {{ItemSearchCriteria}} in {{ItemSearchAction#prepare()}} then {{modelDriven}} will push model onto stack. The problem here is with {{paramsPrepareParamsStack}} where {{modelDriven}} is before {{prepare}} and model is null in that case and it wont be pushed onto stack. 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
[jira] [Commented] (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:comment-tabpanelfocusedCommentId=13661629#comment-13661629 ] Lukasz Lenart commented on WW-4066: --- Or you can move creation of model into {{getModel()}} method from {{prepare()}} method. 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
[jira] [Commented] (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:comment-tabpanelfocusedCommentId=13661635#comment-13661635 ] Chris Cranford commented on WW-4066: bg. Or you can move creation of model into getModel() method from prepare() method. I don't believe that is a viable option because {{getModel()}} is called for every parameter which needs to be set on the model object itself. Putting logic inside that method which needs to determine whether the model needs to be created or not is unnecessary overhead and precisely what I thought {{prepare()}} was designed to offer. I'm very surprised that others who make use of {{ModelDrivenT}} haven't spoken up about this, perhaps they haven't tried to patch. But we make considerable use of {{ModelDriven}} across our entire application and having to alter how models are created in those actions is a serious undertaking, one which after internal discussion would likely leave us at 2.3.4.1 indefinitely. 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
[jira] [Commented] (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:comment-tabpanelfocusedCommentId=13661790#comment-13661790 ] Lukasz Lenart commented on WW-4066: --- The problem isn't related to {{ModelDriven}} but to order of interceptors in {{paramsPrepareParamsStack}} and the mentioned warning is just in {{devMode}} to alert developer that something potentially can be wrong. If you take a look on {{paramsPrepareParamsStack}} you will spot that the {{params}} interceptor is listed two times - before and after {{prepare}}, but there is also {{modelDriven}} listed just before the second {{params}} which will put non-null {{Model}} onto stack. The mentioned warnings come from the first {{params}} as action doesn't have appropriate setters and {{Model}} wasn't yet put onto stack. Even if you add additional {{modelDriven}} interceptor before the first {{params}}, model still won't be on the stack as it is null. That's why I have suggested to create a dedicated interceptor to solve that uncommon situation or move logic to create {{Model}} into {{getModel()}} method. Or leave everything as is as it's just a warning in {{devMode}} ;-) 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
[jira] [Commented] (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:comment-tabpanelfocusedCommentId=13661016#comment-13661016 ] Lukasz Lenart commented on WW-4066: --- I have switched to 2.1.8.1 and the problem still exists :\ 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
[jira] [Commented] (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:comment-tabpanelfocusedCommentId=13659514#comment-13659514 ] Lukasz Lenart commented on WW-4066: --- Could you prepare a small demo app, maven based? 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 Fix For: 2.3.15 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
[jira] [Commented] (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:comment-tabpanelfocusedCommentId=13659867#comment-13659867 ] Lukasz Lenart commented on WW-4066: --- I need that example or more detailed informations how to reproduce the problem. I have been trying just to add an indexed field and override the method as you, but no luck ;-) 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 Fix For: 2.3.15 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
[jira] [Commented] (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:comment-tabpanelfocusedCommentId=13660010#comment-13660010 ] Chris Cranford commented on WW-4066: I will get a demo app together for you later today or first thing in the morning. 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 Fix For: 2.3.15 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