[jira] [Commented] (WW-4144) Have ObjectFactory buildResult obey ParameterNameAware restrictions for a Result

2013-07-30 Thread Jasper Rosenberg (JIRA)

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

Jasper Rosenberg commented on WW-4144:
--

[~lukaszlenart] Sorry, I didn't get a chance to look at the docs last week, I 
was out of town.  Looks good though!

> Have ObjectFactory buildResult obey ParameterNameAware restrictions for a 
> Result
> 
>
> Key: WW-4144
> URL: https://issues.apache.org/jira/browse/WW-4144
> Project: Struts 2
>  Issue Type: Improvement
>  Components: Core Actions
>Affects Versions: 2.3.15.1
>Reporter: Jasper Rosenberg
>Assignee: Lukasz Lenart
>Priority: Minor
>  Labels: ObjectFactory
> Fix For: 2.3.16
>
> Attachments: WW-4144.patch
>
>
> com.opensymphony.xwork2.ObjectFactory#buildResult(ResultConfig, Map), injects 
> all of the resultConfig parameters into the result after it has been built.  
> However, I'd like to be able to have my Result implement ParameterNameAware, 
> and then have buildResult obey its acceptableParameterName() result so I can 
> filter out what parameters can be injected.
> I'm sorry I don't have a proper patch, but it is a very small change.  Only 
> call setProperty on the result if it is not ParameterNameAware, or it is and 
> the parameter name is acceptable.
> {code:java} 
> if ((!(result instanceof ParameterNameAware)) || (((ParameterNameAware) 
> result).acceptableParameterName(paramEntry.getKey( {
> reflectionProvider.setProperty(paramEntry.getKey(), 
> paramEntry.getValue(), result, extraContext, true);
> }
> {code}
> I have been running a Struts 2 app for 6 years with this change in place.  
> Just getting around to suggesting it as a patch :)
> It does also look like the documentation for ParameterNameAware would need to 
> be updated to reflect that it can also be used for results, not just actions.

--
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-4144) Have ObjectFactory buildResult obey ParameterNameAware restrictions for a Result

2013-07-26 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on WW-4144:
-

Commit 1507232 from [~lukaszlenart] in branch 'struts2/trunk'
[ https://svn.apache.org/r1507232 ]

WW-4144 Renames ResultBuilder to ResultFactory to keep convention

> Have ObjectFactory buildResult obey ParameterNameAware restrictions for a 
> Result
> 
>
> Key: WW-4144
> URL: https://issues.apache.org/jira/browse/WW-4144
> Project: Struts 2
>  Issue Type: Improvement
>  Components: Core Actions
>Affects Versions: 2.3.15.1
>Reporter: Jasper Rosenberg
>Priority: Minor
>  Labels: ObjectFactory
> Fix For: 2.3.16
>
> Attachments: WW-4144.patch
>
>
> com.opensymphony.xwork2.ObjectFactory#buildResult(ResultConfig, Map), injects 
> all of the resultConfig parameters into the result after it has been built.  
> However, I'd like to be able to have my Result implement ParameterNameAware, 
> and then have buildResult obey its acceptableParameterName() result so I can 
> filter out what parameters can be injected.
> I'm sorry I don't have a proper patch, but it is a very small change.  Only 
> call setProperty on the result if it is not ParameterNameAware, or it is and 
> the parameter name is acceptable.
> {code:java} 
> if ((!(result instanceof ParameterNameAware)) || (((ParameterNameAware) 
> result).acceptableParameterName(paramEntry.getKey( {
> reflectionProvider.setProperty(paramEntry.getKey(), 
> paramEntry.getValue(), result, extraContext, true);
> }
> {code}
> I have been running a Struts 2 app for 6 years with this change in place.  
> Just getting around to suggesting it as a patch :)
> It does also look like the documentation for ParameterNameAware would need to 
> be updated to reflect that it can also be used for results, not just actions.

--
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-4144) Have ObjectFactory buildResult obey ParameterNameAware restrictions for a Result

2013-07-25 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on WW-4144:
-

Commit 1506872 from [~lukaszlenart] in branch 'struts2/trunk'
[ https://svn.apache.org/r1506872 ]

WW-4144 Defines ParamNameAwareResult interfaces and ResultBuilder to be used 
with

> Have ObjectFactory buildResult obey ParameterNameAware restrictions for a 
> Result
> 
>
> Key: WW-4144
> URL: https://issues.apache.org/jira/browse/WW-4144
> Project: Struts 2
>  Issue Type: Improvement
>  Components: Core Actions
>Affects Versions: 2.3.15.1
>Reporter: Jasper Rosenberg
>Priority: Minor
>  Labels: ObjectFactory
> Fix For: 2.3.16
>
> Attachments: WW-4144.patch
>
>
> com.opensymphony.xwork2.ObjectFactory#buildResult(ResultConfig, Map), injects 
> all of the resultConfig parameters into the result after it has been built.  
> However, I'd like to be able to have my Result implement ParameterNameAware, 
> and then have buildResult obey its acceptableParameterName() result so I can 
> filter out what parameters can be injected.
> I'm sorry I don't have a proper patch, but it is a very small change.  Only 
> call setProperty on the result if it is not ParameterNameAware, or it is and 
> the parameter name is acceptable.
> {code:java} 
> if ((!(result instanceof ParameterNameAware)) || (((ParameterNameAware) 
> result).acceptableParameterName(paramEntry.getKey( {
> reflectionProvider.setProperty(paramEntry.getKey(), 
> paramEntry.getValue(), result, extraContext, true);
> }
> {code}
> I have been running a Struts 2 app for 6 years with this change in place.  
> Just getting around to suggesting it as a patch :)
> It does also look like the documentation for ParameterNameAware would need to 
> be updated to reflect that it can also be used for results, not just actions.

--
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-4144) Have ObjectFactory buildResult obey ParameterNameAware restrictions for a Result

2013-07-25 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on WW-4144:
-

Commit 1506865 from [~lukaszlenart] in branch 'struts2/trunk'
[ https://svn.apache.org/r1506865 ]

WW-4144 Defines new extension point to build Results and adjusts ObjectFactory 
to use it

> Have ObjectFactory buildResult obey ParameterNameAware restrictions for a 
> Result
> 
>
> Key: WW-4144
> URL: https://issues.apache.org/jira/browse/WW-4144
> Project: Struts 2
>  Issue Type: Improvement
>  Components: Core Actions
>Affects Versions: 2.3.15.1
>Reporter: Jasper Rosenberg
>Priority: Minor
>  Labels: ObjectFactory
> Fix For: 2.3.16
>
> Attachments: WW-4144.patch
>
>
> com.opensymphony.xwork2.ObjectFactory#buildResult(ResultConfig, Map), injects 
> all of the resultConfig parameters into the result after it has been built.  
> However, I'd like to be able to have my Result implement ParameterNameAware, 
> and then have buildResult obey its acceptableParameterName() result so I can 
> filter out what parameters can be injected.
> I'm sorry I don't have a proper patch, but it is a very small change.  Only 
> call setProperty on the result if it is not ParameterNameAware, or it is and 
> the parameter name is acceptable.
> {code:java} 
> if ((!(result instanceof ParameterNameAware)) || (((ParameterNameAware) 
> result).acceptableParameterName(paramEntry.getKey( {
> reflectionProvider.setProperty(paramEntry.getKey(), 
> paramEntry.getValue(), result, extraContext, true);
> }
> {code}
> I have been running a Struts 2 app for 6 years with this change in place.  
> Just getting around to suggesting it as a patch :)
> It does also look like the documentation for ParameterNameAware would need to 
> be updated to reflect that it can also be used for results, not just actions.

--
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-4144) Have ObjectFactory buildResult obey ParameterNameAware restrictions for a Result

2013-07-25 Thread Lukasz Lenart (JIRA)

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

Lukasz Lenart commented on WW-4144:
---

First draft of docs, feel free to comment

https://cwiki.apache.org/confluence/display/WW/ObjectFactory#ObjectFactory-Definededicatedbuilder
https://cwiki.apache.org/confluence/display/WW/Result+Types#ResultTypes-Extending

> Have ObjectFactory buildResult obey ParameterNameAware restrictions for a 
> Result
> 
>
> Key: WW-4144
> URL: https://issues.apache.org/jira/browse/WW-4144
> Project: Struts 2
>  Issue Type: Improvement
>  Components: Core Actions
>Affects Versions: 2.3.15.1
>Reporter: Jasper Rosenberg
>Priority: Minor
>  Labels: ObjectFactory
> Fix For: 2.3.16
>
> Attachments: WW-4144.patch
>
>
> com.opensymphony.xwork2.ObjectFactory#buildResult(ResultConfig, Map), injects 
> all of the resultConfig parameters into the result after it has been built.  
> However, I'd like to be able to have my Result implement ParameterNameAware, 
> and then have buildResult obey its acceptableParameterName() result so I can 
> filter out what parameters can be injected.
> I'm sorry I don't have a proper patch, but it is a very small change.  Only 
> call setProperty on the result if it is not ParameterNameAware, or it is and 
> the parameter name is acceptable.
> {code:java} 
> if ((!(result instanceof ParameterNameAware)) || (((ParameterNameAware) 
> result).acceptableParameterName(paramEntry.getKey( {
> reflectionProvider.setProperty(paramEntry.getKey(), 
> paramEntry.getValue(), result, extraContext, true);
> }
> {code}
> I have been running a Struts 2 app for 6 years with this change in place.  
> Just getting around to suggesting it as a patch :)
> It does also look like the documentation for ParameterNameAware would need to 
> be updated to reflect that it can also be used for results, not just actions.

--
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-4144) Have ObjectFactory buildResult obey ParameterNameAware restrictions for a Result

2013-07-19 Thread Jasper Rosenberg (JIRA)

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

Jasper Rosenberg commented on WW-4144:
--

Sounds great, thanks!

> Have ObjectFactory buildResult obey ParameterNameAware restrictions for a 
> Result
> 
>
> Key: WW-4144
> URL: https://issues.apache.org/jira/browse/WW-4144
> Project: Struts 2
>  Issue Type: Improvement
>  Components: Core Actions
>Affects Versions: 2.3.15.1
>Reporter: Jasper Rosenberg
>Priority: Minor
>  Labels: ObjectFactory
> Fix For: 2.3.16
>
> Attachments: WW-4144.patch
>
>
> com.opensymphony.xwork2.ObjectFactory#buildResult(ResultConfig, Map), injects 
> all of the resultConfig parameters into the result after it has been built.  
> However, I'd like to be able to have my Result implement ParameterNameAware, 
> and then have buildResult obey its acceptableParameterName() result so I can 
> filter out what parameters can be injected.
> I'm sorry I don't have a proper patch, but it is a very small change.  Only 
> call setProperty on the result if it is not ParameterNameAware, or it is and 
> the parameter name is acceptable.
> {code:java} 
> if ((!(result instanceof ParameterNameAware)) || (((ParameterNameAware) 
> result).acceptableParameterName(paramEntry.getKey( {
> reflectionProvider.setProperty(paramEntry.getKey(), 
> paramEntry.getValue(), result, extraContext, true);
> }
> {code}
> I have been running a Struts 2 app for 6 years with this change in place.  
> Just getting around to suggesting it as a patch :)
> It does also look like the documentation for ParameterNameAware would need to 
> be updated to reflect that it can also be used for results, not just actions.

--
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-4144) Have ObjectFactory buildResult obey ParameterNameAware restrictions for a Result

2013-07-19 Thread Lukasz Lenart (JIRA)

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

Lukasz Lenart commented on WW-4144:
---

[~perfnorm] ... it's just a small step, but ... ;-) If that will be ok, I will 
refactor the rest :-)

> Have ObjectFactory buildResult obey ParameterNameAware restrictions for a 
> Result
> 
>
> Key: WW-4144
> URL: https://issues.apache.org/jira/browse/WW-4144
> Project: Struts 2
>  Issue Type: Improvement
>  Components: Core Actions
>Affects Versions: 2.3.15.1
>Reporter: Jasper Rosenberg
>Priority: Minor
>  Labels: ObjectFactory
> Fix For: 2.3.16
>
> Attachments: WW-4144.patch
>
>
> com.opensymphony.xwork2.ObjectFactory#buildResult(ResultConfig, Map), injects 
> all of the resultConfig parameters into the result after it has been built.  
> However, I'd like to be able to have my Result implement ParameterNameAware, 
> and then have buildResult obey its acceptableParameterName() result so I can 
> filter out what parameters can be injected.
> I'm sorry I don't have a proper patch, but it is a very small change.  Only 
> call setProperty on the result if it is not ParameterNameAware, or it is and 
> the parameter name is acceptable.
> {code:java} 
> if ((!(result instanceof ParameterNameAware)) || (((ParameterNameAware) 
> result).acceptableParameterName(paramEntry.getKey( {
> reflectionProvider.setProperty(paramEntry.getKey(), 
> paramEntry.getValue(), result, extraContext, true);
> }
> {code}
> I have been running a Struts 2 app for 6 years with this change in place.  
> Just getting around to suggesting it as a patch :)
> It does also look like the documentation for ParameterNameAware would need to 
> be updated to reflect that it can also be used for results, not just actions.

--
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-4144) Have ObjectFactory buildResult obey ParameterNameAware restrictions for a Result

2013-07-19 Thread Jasper Rosenberg (JIRA)

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

Jasper Rosenberg commented on WW-4144:
--

That looks like a great approach, it definitely was a kludge to have to 
overwrite the whole buildResult() method before.

I don't have a specific use case in mind, but I wonder if it would make sense 
to extend this concept to Interceptor parameter injection as well while you are 
thinking about it ObjectFactory.buildInterceptor().

> Have ObjectFactory buildResult obey ParameterNameAware restrictions for a 
> Result
> 
>
> Key: WW-4144
> URL: https://issues.apache.org/jira/browse/WW-4144
> Project: Struts 2
>  Issue Type: Improvement
>  Components: Core Actions
>Affects Versions: 2.3.15.1
>Reporter: Jasper Rosenberg
>Priority: Minor
>  Labels: ObjectFactory
> Fix For: 2.3.16
>
> Attachments: WW-4144.patch
>
>
> com.opensymphony.xwork2.ObjectFactory#buildResult(ResultConfig, Map), injects 
> all of the resultConfig parameters into the result after it has been built.  
> However, I'd like to be able to have my Result implement ParameterNameAware, 
> and then have buildResult obey its acceptableParameterName() result so I can 
> filter out what parameters can be injected.
> I'm sorry I don't have a proper patch, but it is a very small change.  Only 
> call setProperty on the result if it is not ParameterNameAware, or it is and 
> the parameter name is acceptable.
> {code:java} 
> if ((!(result instanceof ParameterNameAware)) || (((ParameterNameAware) 
> result).acceptableParameterName(paramEntry.getKey( {
> reflectionProvider.setProperty(paramEntry.getKey(), 
> paramEntry.getValue(), result, extraContext, true);
> }
> {code}
> I have been running a Struts 2 app for 6 years with this change in place.  
> Just getting around to suggesting it as a patch :)
> It does also look like the documentation for ParameterNameAware would need to 
> be updated to reflect that it can also be used for results, not just actions.

--
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-4144) Have ObjectFactory buildResult obey ParameterNameAware restrictions for a Result

2013-07-19 Thread Lukasz Lenart (JIRA)

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

Lukasz Lenart commented on WW-4144:
---

I'd like change packages, ie. {{org.apache.struts.factory}} or something

> Have ObjectFactory buildResult obey ParameterNameAware restrictions for a 
> Result
> 
>
> Key: WW-4144
> URL: https://issues.apache.org/jira/browse/WW-4144
> Project: Struts 2
>  Issue Type: Improvement
>  Components: Core Actions
>Affects Versions: 2.3.15.1
>Reporter: Jasper Rosenberg
>Priority: Minor
>  Labels: ObjectFactory
> Fix For: 2.3.16
>
> Attachments: WW-4144.patch
>
>
> com.opensymphony.xwork2.ObjectFactory#buildResult(ResultConfig, Map), injects 
> all of the resultConfig parameters into the result after it has been built.  
> However, I'd like to be able to have my Result implement ParameterNameAware, 
> and then have buildResult obey its acceptableParameterName() result so I can 
> filter out what parameters can be injected.
> I'm sorry I don't have a proper patch, but it is a very small change.  Only 
> call setProperty on the result if it is not ParameterNameAware, or it is and 
> the parameter name is acceptable.
> {code:java} 
> if ((!(result instanceof ParameterNameAware)) || (((ParameterNameAware) 
> result).acceptableParameterName(paramEntry.getKey( {
> reflectionProvider.setProperty(paramEntry.getKey(), 
> paramEntry.getValue(), result, extraContext, true);
> }
> {code}
> I have been running a Struts 2 app for 6 years with this change in place.  
> Just getting around to suggesting it as a patch :)
> It does also look like the documentation for ParameterNameAware would need to 
> be updated to reflect that it can also be used for results, not just actions.

--
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-4144) Have ObjectFactory buildResult obey ParameterNameAware restrictions for a Result

2013-07-18 Thread Lukasz Lenart (JIRA)

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

Lukasz Lenart commented on WW-4144:
---

I like the idea, but I don't like to use action related stuff to solve that. 
It'd be better to use something already built-in, without need to override 
Result - just define method/params and you are done.

> Have ObjectFactory buildResult obey ParameterNameAware restrictions for a 
> Result
> 
>
> Key: WW-4144
> URL: https://issues.apache.org/jira/browse/WW-4144
> Project: Struts 2
>  Issue Type: Improvement
>  Components: Core Actions
>Affects Versions: 2.3.15.1
>Reporter: Jasper Rosenberg
>Priority: Minor
>  Labels: ObjectFactory
> Fix For: 2.3.16
>
>
> com.opensymphony.xwork2.ObjectFactory#buildResult(ResultConfig, Map), injects 
> all of the resultConfig parameters into the result after it has been built.  
> However, I'd like to be able to have my Result implement ParameterNameAware, 
> and then have buildResult obey its acceptableParameterName() result so I can 
> filter out what parameters can be injected.
> I'm sorry I don't have a proper patch, but it is a very small change.  Only 
> call setProperty on the result if it is not ParameterNameAware, or it is and 
> the parameter name is acceptable.
> {code:java} 
> if ((!(result instanceof ParameterNameAware)) || (((ParameterNameAware) 
> result).acceptableParameterName(paramEntry.getKey( {
> reflectionProvider.setProperty(paramEntry.getKey(), 
> paramEntry.getValue(), result, extraContext, true);
> }
> {code}
> I have been running a Struts 2 app for 6 years with this change in place.  
> Just getting around to suggesting it as a patch :)
> It does also look like the documentation for ParameterNameAware would need to 
> be updated to reflect that it can also be used for results, not just actions.

--
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-4144) Have ObjectFactory buildResult obey ParameterNameAware restrictions for a Result

2013-07-18 Thread Jasper Rosenberg (JIRA)

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

Jasper Rosenberg commented on WW-4144:
--

Hi Lukasz!  

> Do you use exactly the same ParameterNameAware interface as for actions?

As you can see in the code change I'm proposing above, yes, I think the same 
interface would work well, though the documentation would have to be updated to 
reflect this change.

> What do you do if Result doesn't implement ParameterNameAware?
Again, looking at the code above, it behaves exactly like the 
ParameterInterceptor in that if the Result doesn't implement 
ParameterNameAware, it just does the injection always (as it used to do).

> And how do you use that? Wrap each predefined Result with your custom 
> implementation?
Yes, this came up because I needed to extend ServletActionRedirectResult to 
take a couple additional parameters (including "anchor" which I see is now 
supported since my last struts upgrade, sweet!).
 


> Have ObjectFactory buildResult obey ParameterNameAware restrictions for a 
> Result
> 
>
> Key: WW-4144
> URL: https://issues.apache.org/jira/browse/WW-4144
> Project: Struts 2
>  Issue Type: Improvement
>  Components: Core Actions
>Affects Versions: 2.3.15.1
>Reporter: Jasper Rosenberg
>Priority: Minor
>  Labels: ObjectFactory
> Fix For: 2.3.16
>
>
> com.opensymphony.xwork2.ObjectFactory#buildResult(ResultConfig, Map), injects 
> all of the resultConfig parameters into the result after it has been built.  
> However, I'd like to be able to have my Result implement ParameterNameAware, 
> and then have buildResult obey its acceptableParameterName() result so I can 
> filter out what parameters can be injected.
> I'm sorry I don't have a proper patch, but it is a very small change.  Only 
> call setProperty on the result if it is not ParameterNameAware, or it is and 
> the parameter name is acceptable.
> {code:java} 
> if ((!(result instanceof ParameterNameAware)) || (((ParameterNameAware) 
> result).acceptableParameterName(paramEntry.getKey( {
> reflectionProvider.setProperty(paramEntry.getKey(), 
> paramEntry.getValue(), result, extraContext, true);
> }
> {code}
> I have been running a Struts 2 app for 6 years with this change in place.  
> Just getting around to suggesting it as a patch :)
> It does also look like the documentation for ParameterNameAware would need to 
> be updated to reflect that it can also be used for results, not just actions.

--
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-4144) Have ObjectFactory buildResult obey ParameterNameAware restrictions for a Result

2013-07-18 Thread Lukasz Lenart (JIRA)

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

Lukasz Lenart commented on WW-4144:
---

You use exactly the same {{ParameterNameAware}} interface as for actions? What 
do you do if Result doesn't implement {{ParameterNameAware}}? And do you use 
that? Wrap each predefined Result with your custom implementation?

> Have ObjectFactory buildResult obey ParameterNameAware restrictions for a 
> Result
> 
>
> Key: WW-4144
> URL: https://issues.apache.org/jira/browse/WW-4144
> Project: Struts 2
>  Issue Type: Improvement
>  Components: Core Actions
>Affects Versions: 2.3.15.1
>Reporter: Jasper Rosenberg
>Priority: Minor
>  Labels: ObjectFactory
> Fix For: 2.3.16
>
>
> com.opensymphony.xwork2.ObjectFactory#buildResult(ResultConfig, Map), injects 
> all of the resultConfig parameters into the result after it has been built.  
> However, I'd like to be able to have my Result implement ParameterNameAware, 
> and then have buildResult obey its acceptableParameterName() result so I can 
> filter out what parameters can be injected.
> I'm sorry I don't have a proper patch, but it is a very small change.  Only 
> call setProperty on the result if it is not ParameterNameAware, or it is and 
> the parameter name is acceptable.
> {code:java} 
> if ((!(result instanceof ParameterNameAware)) || (((ParameterNameAware) 
> result).acceptableParameterName(paramEntry.getKey( {
> reflectionProvider.setProperty(paramEntry.getKey(), 
> paramEntry.getValue(), result, extraContext, true);
> }
> {code}
> I have been running a Struts 2 app for 6 years with this change in place.  
> Just getting around to suggesting it as a patch :)
> It does also look like the documentation for ParameterNameAware would need to 
> be updated to reflect that it can also be used for results, not just actions.

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