You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Greg Huber (Jira)" <ji...@apache.org> on 2020/07/08 10:52:00 UTC

[jira] [Commented] (WW-5077) Unable to set long pathname variables

    [ https://issues.apache.org/jira/browse/WW-5077?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17153499#comment-17153499 ] 

Greg Huber commented on WW-5077:
--------------------------------

My logs are now full of these messages (in devMode)

eg for this action: just a search.

<input type="image" src="/images/schview.gif" alt="search" name="action:myClosed" title="Query">

2020-07-08 11:44:54,117 WARN com.opensymphony.xwork2.interceptor.ParametersInterceptor ParametersInterceptor:isAccepted - Parameter [action:myClosed.x] didn't match accepted pattern [[\w+((\.\w+)|(\[\d+\])|(\(\d+\))|(\['(\w|[\u4e00-\u9fa5])+'\])|(\('(\w|[\u4e00-\u9fa5])+'\)))*]]! See Accepted / Excluded patterns at
https://struts.apache.org/security/#accepted--excluded-patterns
2020-07-08 11:44:54,118 WARN com.opensymphony.xwork2.interceptor.ParametersInterceptor ParametersInterceptor:isAccepted - Parameter [action:myClosed.y] didn't match accepted pattern [[\w+((\.\w+)|(\[\d+\])|(\(\d+\))|(\['(\w|[\u4e00-\u9fa5])+'\])|(\('(\w|[\u4e00-\u9fa5])+'\)))*]]! See Accepted / Excluded patterns at
[https://struts.apache.org/security/#accepted--excluded-patterns]

 

#####

eg for this action: This one uses DMI note the bang !

<input name="action:eventAdd!save" type="submit" value="Create" id="eventAdd_eventAdd!save" >

2020-07-08 11:48:55,304 WARN com.opensymphony.xwork2.interceptor.ParametersInterceptor ParametersInterceptor:isExcluded - Parameter [struts.token.name] matches excluded pattern [(^|\%\{)((#?)(top(\.|\['|\[")|\[\d\]\.)?)(dojo|struts|session|request|response|application|servlet(Request|Response|Context)|parameters|context|_memberAccess)(\.|\[).*]! See Accepted / Excluded patterns at
https://struts.apache.org/security/#accepted--excluded-patterns
2020-07-08 11:48:55,304 WARN com.opensymphony.xwork2.interceptor.ParametersInterceptor ParametersInterceptor:isAccepted - Parameter [action:eventAdd!save] didn't match accepted pattern [[\w+((\.\w+)|(\[\d+\])|(\(\d+\))|(\['(\w|[\u4e00-\u9fa5])+'\])|(\('(\w|[\u4e00-\u9fa5])+'\)))*]]! See Accepted / Excluded patterns at
https://struts.apache.org/security/#accepted--excluded-patterns
2020-07-08 11:48:55,397 WARN com.opensymphony.xwork2.util.AbstractLocalizedTextProvider AbstractLocalizedTextProvider:findDefaultText - Missing key [bean.name.required] in bundles [[ApplicationResources, org/apache/struts2/struts-messages, com/opensymphony/xwork2/xwork-messages]]!
2020-07-08 11:48:55,401 WARN com.opensymphony.xwork2.util.AbstractLocalizedTextProvider AbstractLocalizedTextProvider:findDefaultText - Missing key [bean.description.required] in bundles [[ApplicationResources, org/apache/struts2/struts-messages, com/opensymphony/xwork2/xwork-messages]]!

 

> Unable to set long pathname variables
> -------------------------------------
>
>                 Key: WW-5077
>                 URL: https://issues.apache.org/jira/browse/WW-5077
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.3.24
>            Reporter: Stephan
>            Priority: Major
>             Fix For: 2.5.23, 2.6
>
>         Attachments: Struts2Sample.zip, Struts2Sample2.zip
>
>          Time Spent: 2h
>  Remaining Estimate: 0h
>
>  
> I implemented a simple struts2+tiles (Struts 2 core version: 2.3.24.1) as a test case to verify an issue that have.
> In detail, i have the following Struts form:
> {code:java}
> <s:form action="save">
>             <s:hidden name="metadataTest.name" value="Level-1_new" />
>             <s:hidden name="metadataTest.metadataList[0].name" value="Level-2_new" />
>             <s:hidden name="metadataTest.metadataList[0].metadataList[0].name" value="Level-3_new" />
>             <s:hidden name="metadataTest.metadataList[0].metadataList[0].metadataList[0].name" value="Level-4_new" />
>             <s:hidden name="metadataTest.metadataList[0].metadataList[0].metadataList[0].metadataList[0].name" value="Level-5_new" />
>             <s:hidden name="metadataTest.metadataList[0].metadataList[0].metadataList[0].metadataList[0].metadataList[0].name" value="Level-6_new" />
>             <s:hidden name="metadataTest.metadataList[0].metadataList[0].metadataList[0].metadataList[0].metadataList[0].metadataList[0].name" value="Level-7_new" />
>             <s:submit/>
>  </s:form> 
> {code}
> The metadataTest class:
> {code:java}
> public class Metadata implements Serializable {
> /** The Constant serialVersionUID. */
> private static final long serialVersionUID = 5902230367443812176L;
> private String name;
> private ArrayList<Metadata> metadataList;
> public Metadata() {
> }
> public String getName() {
>     return name;
> }
> public void setName(String name) {
>     this.name = name;
> }
> public ArrayList<Metadata> getMetadataList() {
>     return metadataList;
> }
> public void setMetadataList(ArrayList<Metadata> metadataList) {
>     this.metadataList = metadataList;
> }
> }
> {code}
> My issue here is following. When i submit this form, all values up to this level, are set correctly
> {code:java}
> <s:hidden name="metadataTest.metadataList[0].metadataList[0].metadataList[0].metadataList[0].metadataList[0].name" value="Level-6_new" />
> {code}
> For some reason the below hidden element is never set, instead, the medataList at level 6 is null, while the name set by the hidden field above, is set correctly.
> {code:java}
> <s:hidden name="metadataTest.metadataList[0].metadataList[0].metadataList[0].metadataList[0].metadataList[0].metadataList[0].name" value="Level-7_new" />
> {code}
> Is there any kind of limitation by struts concerning the depth in a list hierarchie or maybe the length of path to set a value ? I could not find something related.
> *Note 1*: It surely has to do something with the length of the parameters. Once i changed the variable names to longer ones, i was able to set values only up to Level 3.
> *Note 2*: Downgrading to Struts 2.1.6 resolves the issue. Also latest version 2.5.22 seems to be afffected from the exact same issue. Is there any workaround ?
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)