You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Kishan G. Chellap Paandy" <ki...@spanservices.com> on 2009/06/09 17:09:43 UTC

Struts2 - redirectAction - ServletActionRedirectResult

Hi Folks,

 In Struts 2.1.6, if we have a <result name="success" type="redirectAction">, for example, 

 <result name="showReportResult" type="redirectAction">
          <param name="actionName">generateReport</param>
          <param name="namespace">/genReport</param>
          <param name="reportType">pie</param>
 
Refer to: http://struts.apache.org/2.1.6/struts2-core/apidocs/org/apache/struts2/dispatcher/ServletActionRedirectResult.html   

We will get errors in the log as:

ERROR (CommonsLogger.java:27) - Unable to set parameter [reportType] in result of type [org.apache.struts2.dispatcher.ServletActionRedirectResult]
Caught OgnlException while setting property ' reportType ' 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)
          at com.opensymphony.xwork2.DefaultActionInvocation.createResult(DefaultActionInvocation.java:208)
          at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:355)
          at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:265) 
Note: I don't have a setProperty for reportType in GenerateReport action class. I will get the reportType param from request and use it.

Is this because, for reportType there is no setProperty in ServletActionRedirectResult or in GenerateReport action class?
Is this a bug? Or I need to have a setProperty for reportType in GenerateReport action class?
Please advice.

Thank you.
Regards,
Kishan.G


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org