Author: thomas.heute(a)jboss.com
Date: 2007-07-30 12:15:30 -0400 (Mon, 30 Jul 2007)
New Revision: 7844
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/controller/classic/OtherResponseHandler.java
Log:
JBPORTAL-1617: sendRedirect() not working (leading to a blank page)
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/controller/classic/OtherResponseHandler.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/controller/classic/OtherResponseHandler.java 2007-07-30
13:17:03 UTC (rev 7843)
+++
branches/JBoss_Portal_Branch_2_6/core/src/main/org/jboss/portal/core/controller/classic/OtherResponseHandler.java 2007-07-30
16:15:30 UTC (rev 7844)
@@ -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