if (Jetspeed.getEngine() != null)
{
request.setAttribute(PortalReservedParameters.PIPELINE, PortalReservedParameters.LOGIN_PIPELINE);
Engine engine = Jetspeed.getEngine();
RequestContextComponent contextComponent = null;
RequestContext context = null;
try
{
String jetuiMode = Jetspeed.getConfiguration().getString(PortalConfigurationConstants.JETUI_CUSTOMIZATION_METHOD, PortalConfigurationConstants.JETUI_CUSTOMIZATION_SERVER);
boolean redirectHomeSpace = Jetspeed.getConfiguration().getBoolean(PortalConfigurationConstants.JETUI_REDIRECT_HOME_SPACE, true);
if (redirectHomeSpace && jetuiMode.equals(PortalConfigurationConstants.JETUI_CUSTOMIZATION_AJAX)) {
String destination = (String)session.getAttribute(LoginConstants.DESTINATION);
if (destination == null) destination = "/";
String username = (String)session.getAttribute(LoginConstants.USERNAME);
if (username != null) {
if (!destination.endsWith("/"))
destination += "/";
destination += (Folder.RESERVED_USER_FOLDER_NAME + "/" + username);
session.setAttribute(LoginConstants.DESTINATION, destination);
}
}
contextComponent = (RequestContextComponent) Jetspeed.getComponentManager().getComponent(RequestContextComponent.class);
context = contextComponent.create(request, response, getServletConfig());
engine.service(context);
}
catch (JetspeedException e)
{
log.warn("Jetspeed engine does not work properly.", e);
// forward to JetspeedServlet
response.sendRedirect(response.encodeURL(request.getContextPath() + "/"));
}
finally
{
if (contextComponent != null)
{
contextComponent.setRequestContext(null);
}
}
}
else
{