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

Shawn Andrews commented on WW-4137:
-----------------------------------

Bruce, 
Could you explain why it is not an issue? Are you saying I should probably just 
ignore or hide the warning / stack trace? I am fine with doing that if this is 
not causing any issues, and it is just a warning.
The reason I reported it is that it did not happen before, but it started 
happening in the new version (and I could not find anything in the version logs 
describing the change,  do you know the change that is causing the warning). 

Also could you explain why using ParameterNameAware interceptor is bad practice?

the documentation says it is best practice to do this:
http://struts.apache.org/release/2.0.x/struts2-core/apidocs/com/opensymphony/xwork2/interceptor/ParametersInterceptor.html
"The best way to add behavior to this interceptor is to utilize the 
ParameterNameAware interface in your actions." 
It also says
" ... if the action being invoked implements the ParameterNameAware interface, 
the action will be consulted to determine if the parameter should be set."


So I have a function acceptableParameterName in the action (that implements 
ParameterNameAware), that will declare certain variables to not be set. In the 
example I gave you it is allowing all parameters to be set (since it just 
returns true) but in my actual code I am ignoring certain parameters. 
(Basically I have a black list of parameters I am rejecting  as described here 
http://struts.apache.org/release/2.0.x/struts2-core/apidocs/com/opensymphony/xwork2/interceptor/ParameterNameAware.html).
 Which means if the parameter is one of the black listed parameters then 
acceptableParameterName return false ... else it returns true.

Is this not exactly what the documentation says is the best practice way to do 
what I want to do?  What am I missing?


                
> Parameter warnings being generated in logs after 2.3.7 in portlet
> -----------------------------------------------------------------
>
>                 Key: WW-4137
>                 URL: https://issues.apache.org/jira/browse/WW-4137
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Portlet
>    Affects Versions: 2.3.7, 2.3.8, 2.3.12, 2.3.14, 2.3.14.1, 2.3.14.2, 
> 2.3.14.3, 2.3.15
>         Environment: liferay portal running in tomcat
>            Reporter: Shawn Andrews
>            Assignee: Bruce Phillips
>            Priority: Minor
>             Fix For: 2.3.16
>
>
> I tried to migrate some portlets from 2.3.4  to 2.3.7 (actually to 2.3.15 but 
> have found that the problem starts in 2.3.7)
> What happens is there is now a warning in the logs whenever I execute an 
> action.
> 09:33:35,327 WARN  [OgnlValueStack:60] Error setting expression 
> 'struts.portlet.action' with value '[Ljava.lang.String;@78f28bba'
> ognl.OgnlException: source is null for getProperty(null, "portlet")
> It seems that in older versions of struts portlet plugin this parameter use 
> to be taken out,  since I believe it is used by struts2 to know what action 
> to execute, but should maybe not be stored in the OGNL stack.   My guess is 
> that this has to do with no field called 'portlet'  with property 'action' in 
> my action class existing to place the expression.
> In version 2.3.4.1 and previous this was not an issue. Maybe the portlet 
> interceptor was taking this parameters out before it was placed into OGNL, 
> and now it is being left?

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

Reply via email to