struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Li Ying <liying.cn.2...@gmail.com>
Subject Re: Setting object from param tag fails in Struts 2.2.1
Date Mon, 15 Nov 2010 13:21:18 GMT
"[Ljava.lang.String;" means a String array.

Looks like you are trying to copy a List from one action to another.

By somehow, struts2 is looking for a set method which take a String
array as it's parameter.



2010/11/15 Raj Nagappan <raj@velocitylabs.com>:
> Hi, we recently upgraded from Struts 2.0.14 to 2.2.1 and I notice that
>
> the following JSP code to inject an object property from one action into
> another action has stopped working:
>
> <s:if test="photoSet.keywordListLazyLoad != null">
> <s:action namespace="/search" name="KeywordList" executeResult="true"
> ignoreContextParams="true">
> <s:param name="keywordList" value="photoSet.keywordListLazyLoad"/>
> </s:action>
> </s:if>
>
> So it checks that the object is not null and then tries to set it on the
> parameter "keywordList". This worked perfectly fine in 2.0.x, but in 2.2
> on the server side we get:
>
> java.lang.NoSuchMethodException:
> KeywordListAction.setKeywordList([Ljava.lang.String;)
>    at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1226)
>    at ognl.OgnlRuntime.setMethodValue(OgnlRuntime.java:1474)
>    at
> ognl.ObjectPropertyAccessor.setPossibleProperty(ObjectPropertyAccessor.java:85)
>    at
> ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:162)
>
> And the resulting error displayed on the web page is:
>
> Exception name: No result defined for action KeywordListAction and
> result input
> No result defined for action KeywordListAction and result input at
> com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:375)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:277)
> at
> com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:263)
> at
> org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept
> (AnnotationValidationInterceptor.java:68) at
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept
>
> Is this a bug or do I need to do something differently for 2.2?
>
> Raj.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

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


Mime
View raw message