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

Miguel Monreal commented on WW-1714:
------------------------------------

Alf is right. Now Struts 2.1.6 is logging this at ERROR level.

I see this issue closed but  I think it would be better to come back to log 
this at WARN level, wouldn't it?
Temporarily, I have avoided this annoying message adding this line to log4j 
file, because the message was appearing with devMode=false too:

log4j.logger.com.opensymphony.xwork2.ObjectFactory = FATAL

Thanks ;)


> Using the Redirect Action Result with parameters to the target action causes 
> an OGNL warning
> --------------------------------------------------------------------------------------------
>
>                 Key: WW-1714
>                 URL: https://issues.apache.org/struts/browse/WW-1714
>             Project: Struts 2
>          Issue Type: Bug
>    Affects Versions: 2.0.5
>         Environment: WinXP; JDK 1.5; WebLogic 9.2; Struts 2.0.5; XWork 2.0.0
>            Reporter: Erik Pilz
>            Assignee: Don Brown
>             Fix For: 2.0.8
>
>
> Passing request parameters to the "redirect-action" result, which maps to 
> org.apache.struts2.dispatcher.ServletActionRedirectResult, will log a warning 
> message for every request parameter for the target action. The expected 
> result is that the warning only be logged when struts.devMode is true. 
> To reproduce the problem use the last example from 
> http://struts.apache.org/2.x/docs/redirect-action-result.html. Here it is 
> reproduced for your reference:
> <package name="passingRequestParameters" extends="struts-default" 
> namespace="/passingRequestParameters">
>    <-- Pass parameters (reportType, width and height) -->
>    <!--
>    The redirect-action url generated will be :
>    /genReport/generateReport.action?userId=pie&width=100&height=100
>    -->
>    <action name="gatherReportInfo" class="...">
>       <result name="showReportResult" type="redirect-action">
>          <param name="actionName">generateReport</param>
>          <param name="namespace">/genReport</param>
>          <param name="reportType">pie</param>
>          <param name="width">100</param>
>          <param name="height">100</param>
>       </result>
>    </action>
> </package>
> And here's an example of the warning that is reported for a parameter named 
> "userId" that is passed to the action:
> 2007-02-06 11:19:02,086 WARN  [nsymphony.xwork2.util.OgnlUtil] Caught 
> OgnlException while setting property 'userId' on type 
> 'org.apache.struts2.dispatcher.ServletActionRedirectResult'.
> ognl.NoSuchPropertyException: 
> org.apache.struts2.dispatcher.ServletActionRedirectResult.userId
>       at 
> ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:132)
>       at 
> com.opensymphony.xwork2.util.OgnlValueStack$ObjectAccessor.setProperty(OgnlValueStack.java:68)
>       at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1670)
>       at ognl.ASTProperty.setValueBody(ASTProperty.java:101)
>       at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
>       at ognl.SimpleNode.setValue(SimpleNode.java:246)
>       at ognl.Ognl.setValue(Ognl.java:476)
>       at com.opensymphony.xwork2.util.OgnlUtil.setValue(OgnlUtil.java:186)
>       at 
> com.opensymphony.xwork2.util.OgnlUtil.internalSetProperty(OgnlUtil.java:360)
>       at com.opensymphony.xwork2.util.OgnlUtil.setProperties(OgnlUtil.java:76)
>       at com.opensymphony.xwork2.util.OgnlUtil.setProperties(OgnlUtil.java:49)
>       at 
> com.opensymphony.xwork2.ObjectFactory.buildResult(ObjectFactory.java:218)
>       at 
> com.opensymphony.xwork2.DefaultActionInvocation.createResult(DefaultActionInvocation.java:190)
>       at 
> com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:337)
>       at 
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
>       at 
> com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:213)
>       at 
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
>       at 
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:219)
>       at 
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:218)
>       at 
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
>       at 
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:216)
>       at 
> com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:115)
>       at 
> org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:48)
>       at 
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
>       at 
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:219)
>       at 
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:218)
>       at 
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
>       at 
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:216)
>       at 
> com.opensymphony.xwork2.interceptor.ParametersInterceptor.intercept(ParametersInterceptor.java:161)
>       at 
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:219)
>       at 
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:218)
>       at 
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to