You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Lukasz Lenart <lu...@apache.org> on 2013/08/01 16:00:54 UTC

Re: Issue with parameters with Struts 2.3.15.1

Can you test with the latest SNAPSHOT? This can be related to
https://issues.apache.org/jira/browse/WW-4142

And you can directly use DefaultActionMapper from 2.3.15.1, just copy the
code and define your custom Action mapper as specified in the docs.


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

2013/7/31 Thim Anneessens <t....@ictjob.be>

>  Hi Struts users,
>
> I am having problems migrating from version 2.3.1.2 to version 2.3.15.1.
> This upgrade seems pretty important as it fixes a known security issue.
>
> The problem I am having is the that apparently, I can no longer check if a
> property has been given to my Struts component (using s:component and
> s:param)  by testing that the value associated to the parameter key in the
> "parameters" is equal to null.
>
> Test
>
> *This is the code of the component that I call:*
>
> <h1>Param items</h1>
>
> <s:property value="parameters.items.class.name"/>
>
> <h1>Radom param name</h1>
>
> <s:property value="parameters.radomParamnameDynamo.class.name"/><br/>
>
> <s:property value="parameters.radomParamnameDynamo"/><br/>
>
> <s:property value="parameters.radomParamnameDynamo"/><br/>
>
> <s:property value="parameters.radomParamnameDynamo2"/>
>
> <s:property value="test"/>
>
>
> *Here is the call to the component:*
>
> <s:component template="TestComponent.jsp">
> </s:component>
>
> * And here is the produced output (without html marking)*
>
> Param items
>
> java.lang.Object		#Output of <s:property value="parameters.items.class.name"/>
>
>
> Radom param name		
>
> java.lang.Object		#Output of <s:property value="parameters.radomParamnameDynamo.class.name"/>
>
> java.lang.Object@3c0e5477	#Output of <s:property value="parameters.radomParamnameDynamo"/>
>
>
> java.lang.Object@3c0e5477	#Output of <s:property value="parameters.radomParamnameDynamo"/> (the second one)
>
> java.lang.Object@e91824        	#Output of <s:property value="parameters.radomParamnameDynamo2"/>
>
> test				#Output of <s:property value="test"/>
>
>
> *Note: *test is a property of the action that should return the "test"
> string. OK. I
>
> Environment
>
>    - Java 6
>     - struts-javatemplate-plugin (same version as struts)
>    - JRebel
>    - Tomcat (restarted and cleaned), Eclipse(restarted & project
>    recompiled)
>
> Analysis
>
>    - Action properties are acting as before (I've checked with the
>    debugger, and the non existence of an action property result in a null
>    value)
>     - The Component "parameters" object will always return a value (even
>    if it is an object)
>     - By using the debugger, we can see that accessing an unexisting
>    "parameters" key will result in the creation of this "parameters" key and
>    its association to an object of type Object.
>    - 2 unexisting "parameters" key will result in the association of 2
>    distinct objects of type Object. (as illustrated in the output of the Test)
>
> What I have tried
> I hope I provided enough information and that you will be able to tell me
> what I do wrong, how I could get out of this mess or that there is a bug ;).
>
> Best regards, and thanks to the Team for all the good work,
>
> --
>  * Thim Anneessens
> IT Department *
>
> [image: ictjob group]
>
>

Re: Issue with parameters with Struts 2.3.15.1

Posted by Thim Anneessens <t....@ictjob.be>.
Ok, i'll test this and I'll come back to you.

Thanks.

On 08/01/2013 04:00 PM, Lukasz Lenart wrote:
> Can you test with the latest SNAPSHOT? This can be related to 
> https://issues.apache.org/jira/browse/WW-4142
>
> And you can directly use DefaultActionMapper from 2.3.15.1, just copy 
> the code and define your custom Action mapper as specified in the docs.
>
>
> Regards
> -- 
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> 2013/7/31 Thim Anneessens <t.anneessens@ictjob.be 
> <ma...@ictjob.be>>
>
>     Hi Struts users,
>
>     I am having problems migrating from version 2.3.1.2 to version
>     2.3.15.1. This upgrade seems pretty important as it fixes a known
>     security issue.
>
>     The problem I am having is the that apparently, I can no longer
>     check if a property has been given to my Struts component (using
>     s:component and s:param)  by testing that the value associated to
>     the parameter key in the "parameters" is equal to null.
>
>
>           Test
>
>     _This is the code of the component that I call:_
>
>     <h1>Param items</h1>
>
>     <s:property value="parameters.items.class.name  <http://parameters.items.class.name>"/>
>
>     <h1>Radom param name</h1>
>
>     <s:property value="parameters.radomParamnameDynamo.class.name  <http://parameters.radomParamnameDynamo.class.name>"/><br/>
>
>     <s:property value="parameters.radomParamnameDynamo"/><br/>
>
>     <s:property value="parameters.radomParamnameDynamo"/><br/>
>
>     <s:property value="parameters.radomParamnameDynamo2"/>
>
>     <s:property value="test"/>
>
>
>     _Here is the call to the component:_
>
>     <s:component template="TestComponent.jsp">
>     </s:component>
>
>     _And here is the produced output (without html marking)_
>
>     Param items
>
>     java.lang.Object		#Output of <s:property value="parameters.items.class.name  <http://parameters.items.class.name>"/>
>
>     Radom param name		
>
>     java.lang.Object		#Output of <s:property value="parameters.radomParamnameDynamo.class.name  <http://parameters.radomParamnameDynamo.class.name>"/>
>
>     java.lang.Object@3c0e5477	#Output of <s:property value="parameters.radomParamnameDynamo"/>
>
>
>     java.lang.Object@3c0e5477	#Output of <s:property value="parameters.radomParamnameDynamo"/> (the second one)
>
>     java.lang.Object@e91824        	#Output of <s:property value="parameters.radomParamnameDynamo2"/>
>
>     test				#Output of <s:property value="test"/>
>
>
>     *Note: *test is a property of the action that should return the
>     "test" string. OK. I
>
>
>           Environment
>
>       * Java 6
>       * struts-javatemplate-plugin (same version as struts)
>       * JRebel
>       * Tomcat (restarted and cleaned), Eclipse(restarted & project
>         recompiled)
>
>
>           Analysis
>
>       * Action properties are acting as before (I've checked with the
>         debugger, and the non existence of an action property result
>         in a null value)
>       * The Component "parameters" object will always return a value
>         (even if it is an object)
>       * By using the debugger, we can see that accessing an unexisting
>         "parameters" key will result in the creation of this
>         "parameters" key and its association to an object of type Object.
>       * 2 unexisting "parameters" key will result in the association
>         of 2 distinct objects of type Object. (as illustrated in the
>         output of the Test)
>
>
>           What I have tried
>
>
>     I hope I provided enough information and that you will be able to
>     tell me what I do wrong, how I could get out of this mess or that
>     there is a bug ;).
>
>     Best regards, and thanks to the Team for all the good work,
>
>     -- 
>     *Thim Anneessens
>     IT Department *
>
>     ictjob group
>
>


-- 
*Thim Anneessens
IT Department *

ictjob group