Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Miguel Ángel Júlvez
ResourceResponseImpl cannot be cast to javax.portlet.ActionResponse
October 4, 2011 9:30 AM
Answer

Miguel Ángel Júlvez

Rank: Junior Member

Posts: 58

Join Date: March 29, 2011

Recent Posts

Hi!

I'm getting this error

1java.lang.ClassCastException: com.liferay.portlet.ResourceResponseImpl cannot be cast to javax.portlet.ActionResponse


when I do

1import javax.faces.context.ExternalContext;
2import javax.portlet.ActionResponse;
3...
4ActionResponse actionResponse =
5                    (ActionResponse) externalContext.getResponse();
6...
7
8I' using Liferay 6.1, liferayfaces 6.0.0.1, portletfaces-bridge-2.0.1,  jsf-api-2.1.2, jsf-impl-2.1.2 and alloyfaces 1.0.1.1 on tomcat 7


Anyone can help me??

Thanks!
Neil Griffin
RE: ResourceResponseImpl cannot be cast to javax.portlet.ActionResponse
October 4, 2011 10:34 AM
Answer

Neil Griffin

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2365

Join Date: July 26, 2005

Recent Posts

If you're getting ResourceResponseImpl back from the call to externalContext.getResponse() then it's happening in an Ajax call, probably from the f:ajax tag in your view.

Probably better to cast it to MimeResponse rather than ActionResponse, which only happens during a full postback (non Ajax) use case.
Miguel Ángel Júlvez
RE: ResourceResponseImpl cannot be cast to javax.portlet.ActionResponse
October 5, 2011 5:52 AM
Answer

Miguel Ángel Júlvez

Rank: Junior Member

Posts: 58

Join Date: March 29, 2011

Recent Posts

Thanks!