On Wed, Jun 10, 2009 at 7:16 AM, Kishan
Paandy<kishanchellapaand...@spanservices.com> wrote:
>
> Hi Folks,
>
>  In Struts 2.1.6, if we have a <result name="success"
> type="redirectAction">, for example,
>
>  <result name="showReportResult" type="redirectAction">
>          generateReport
>          /genReport
>          pie
>
> 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.
>


Ignore it... Using OGNL and family is tricky business, and in the
"before time" we used to throw away errors about not having
getters/setters when the framework expected them. In this case, xwork
seems upset that the getters and setters aren't there on the
ServletActionRedirectResult class. Go ahead and file a bug if you'd
like and we'll try to keep them from popping up, but you can safely
ignore it in your app.

-Wes

-- 
Wes Wannemacher
Author - Struts 2 In Practice
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher

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

Reply via email to