留言板

Obtain ActionResponse from LiferayFacesContext

thumbnail
Jubril Oyesiji,修改在12 年前。

Obtain ActionResponse from LiferayFacesContext

Junior Member 帖子: 35 加入日期: 12-2-9 最近的帖子
Hello,
I am trying to obtain ActionResponse from LiferayFacesContext but anytime i try to cast the object i get this exception

try{
ActionResponse rs=(ActionResponse) LiferayFacesContext.getInstance().getExternalContext().getResponse();
rs.setProperty("myValue", "Jubril Oyesiji");

}catch(Exception e){
e.printStackTrace();
}



java.lang.ClassCastException: com.liferay.portlet.ResourceResponseImpl
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.
at com.abbey.AbbeyBean.submit(AbbeyBean.java:36)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:328)
at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:341)
at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)

Any help will be appreciated
thumbnail
Ravi Kumar Gupta,修改在12 年前。

RE: Obtain ActionResponse from LiferayFacesContext

Liferay Legend 帖子: 1302 加入日期: 09-6-24 最近的帖子
Can you attach the portlet source. By looking at the exception it seems that you are trying to cast incorrectly.. Can you try casting it to ResourceResponse and see if that works.. ??
thumbnail
Jubril Oyesiji,修改在12 年前。

RE: Obtain ActionResponse from LiferayFacesContext

Junior Member 帖子: 35 加入日期: 12-2-9 最近的帖子
it does cast to ResourceResponse but i am looking to retrieve ActionResponse like in this tutorials

http://liferay-blogging.blogspot.com/2011/05/inter-portlet-communication-in-liferay.html