[gatein-commits] gatein SVN: r2265 - portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application.
do-not-reply at jboss.org
do-not-reply at jboss.org
Mon Mar 15 14:24:17 EDT 2010
Author: mwringe
Date: 2010-03-15 14:24:17 -0400 (Mon, 15 Mar 2010)
New Revision: 2265
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletActionListener.java
Log:
GTNPORTAL-896: handle security responses from the portlet container and log the specific errors to the logs.
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletActionListener.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletActionListener.java 2010-03-15 18:16:46 UTC (rev 2264)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletActionListener.java 2010-03-15 18:24:17 UTC (rev 2265)
@@ -49,6 +49,8 @@
import org.gatein.pc.api.invocation.response.ErrorResponse;
import org.gatein.pc.api.invocation.response.HTTPRedirectionResponse;
import org.gatein.pc.api.invocation.response.PortletInvocationResponse;
+import org.gatein.pc.api.invocation.response.SecurityErrorResponse;
+import org.gatein.pc.api.invocation.response.SecurityResponse;
import org.gatein.pc.api.invocation.response.UpdateNavigationalStateResponse;
import javax.portlet.PortletMode;
@@ -141,6 +143,10 @@
{
handleErrorResponse((ErrorResponse)portletResponse);
}
+ else if (portletResponse instanceof SecurityResponse)
+ {
+ handleSecurityResponse((SecurityResponse)portletResponse);
+ }
else
{
throw new Exception("Unexpected response type [" + portletResponse + "]. Expected an UpdateNavigationResponse" +
@@ -246,6 +252,19 @@
{
throw (Exception)response.getCause();
}
+
+ private void handleSecurityResponse(SecurityResponse response) throws Exception
+ {
+ if (response instanceof SecurityErrorResponse)
+ {
+ SecurityErrorResponse securityErrorResponse = (SecurityErrorResponse)response;
+ throw new Exception("SecurityErrorResponse Returned while trying to process portlet action. ", securityErrorResponse.getThrowable());
+ }
+ else
+ {
+ throw new Exception("Security Response of type " + response.getClass() + " encountered while trying to process portlet action.");
+ }
+ }
}
/**
More information about the gatein-commits
mailing list