Author: thomas.heute(a)jboss.com
Date: 2007-07-30 12:17:26 -0400 (Mon, 30 Jul 2007)
New Revision: 7845
Modified:
trunk/core/src/main/org/jboss/portal/core/controller/classic/OtherResponseHandler.java
Log:
JBPORTAL-1617: sendRedirect() not working (leading to a blank page)
Modified:
trunk/core/src/main/org/jboss/portal/core/controller/classic/OtherResponseHandler.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/controller/classic/OtherResponseHandler.java 2007-07-30
16:15:30 UTC (rev 7844)
+++
trunk/core/src/main/org/jboss/portal/core/controller/classic/OtherResponseHandler.java 2007-07-30
16:17:26 UTC (rev 7845)
@@ -29,6 +29,7 @@
import org.jboss.portal.core.controller.ControllerContext;
import org.jboss.portal.core.controller.ControllerCommand;
import org.jboss.portal.core.controller.ControllerResponse;
+import org.jboss.portal.core.controller.command.response.RedirectionResponse;
import org.jboss.portal.core.controller.command.response.SignOutResponse;
import org.jboss.portal.core.controller.command.response.StreamContentResponse;
import org.jboss.portal.core.controller.command.response.ErrorResponse;
@@ -105,6 +106,24 @@
//
return HTTPResponse.sendRedirect(location);
}
+ else if (controllerResponse instanceof RedirectionResponse)
+ {
+ // Get the optional signout location
+ String location = ((RedirectionResponse)controllerResponse).getLocation();
+
+ //
+ if (location == null)
+ {
+ PortalObjectContainer portalObjectContainer =
controllerContext.getController().getPortalObjectContainer();
+ Portal portal =
(Portal)portalObjectContainer.getObject(DEFAULT_PORTAL_PATH);
+ ViewPageCommand renderCmd = new ViewPageCommand(portal.getId());
+ URLContext urlContext = invocation.getServerContext().getURLContext();
+ location = controllerContext.renderURL(renderCmd, urlContext, null);
+ }
+
+ //
+ return HTTPResponse.sendRedirect(location);
+ }
else if (controllerResponse instanceof StreamContentResponse)
{
StreamContentResponse scr = (StreamContentResponse)controllerResponse;
Show replies by date