You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Alf Thomas Nilsen (JIRA)" <ji...@apache.org> on 2009/01/22 18:25:45 UTC
[jira] Commented: (WW-1714) Using the Redirect Action Result with
parameters to the target action causes an OGNL warning
[ https://issues.apache.org/struts/browse/WW-1714?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45503#action_45503 ]
Alf Thomas Nilsen commented on WW-1714:
---------------------------------------
With 2.1.6, this now seems to be logged at the ERROR level.:
[ERROR] ObjectFactory - Unable to set parameter [id] in result of type [org.apache.struts2.dispatcher.ServletActionRedirectResult] <Caught O
gnlException while setting property 'id' on type 'org.apache.struts2.dispatcher.ServletActionRedirectResult'. - Class: ognl.ObjectPropertyAc
cessor
File: ObjectPropertyAccessor.java
Method: setProperty
Line: 132 - ognl/ObjectPropertyAccessor.java:132:-1>Caught OgnlException while setting property 'id' on type 'org.apache.struts2.dispatcher.
ServletActionRedirectResult'. - Class: ognl.ObjectPropertyAccessor
File: ObjectPropertyAccessor.java
Method: setProperty
Line: 132 - ognl/ObjectPropertyAccessor.java:132:-1
at com.opensymphony.xwork2.ognl.OgnlUtil.internalSetProperty(OgnlUtil.java:392)
at com.opensymphony.xwork2.ognl.OgnlUtil.setProperty(OgnlUtil.java:143)
at com.opensymphony.xwork2.ognl.OgnlReflectionProvider.setProperty(OgnlReflectionProvider.java:91)
at com.opensymphony.xwork2.ObjectFactory.buildResult(ObjectFactory.java:221)
By looking at the source code, this seems to happen because ObjectFactory.buildResult() tells the reflectionProvider to throw exceptions when setting the properties (see ObjectFactory.java line 221). Because of this, a ReflectionException will be thrown by the internalSetProperty method of the OgnlUtil class (line 392) and it will be logged at ObjectFactory.java line 224).
> 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.