package org.jasig.portal.rendering;

import org.springframework.beans.factory.annotation.Required;
import org.springframework.util.Assert;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * PortalRenderingPipeline that issues a redirect to a configured path.
 * Intended as a Pipeline implementation that might be plugged into a branch in the overall rendering pipeline and
 * conditionally actuated.
 * @since uPortal 4.2
 */
public class RedirectRenderingPipelineTerminator
    implements IPortalRenderingPipeline {

    /**
     * Path to which terminator will redirect.
     */
    private String redirectTo;

    @Override
    public void renderState(final HttpServletRequest request, final HttpServletResponse response)
            throws ServletException, IOException {

        if (null == this.redirectTo) {
            throw new IllegalStateException("RedirectRenderingPipelineTerminator must be configured " +
                    "with path to which to redirect.");
        }

        response.sendRedirect(this.redirectTo);
        
    }

    /**
     * Set the path to which the pipeline terminator should redirect.
     * Required.
     * @param targetPath non-null path String suitable for presentation to response.sendRedirect().
     * @throws IllegalArgumentException if targetPath is null.
     */
    @Required
    public void setRedirectTo(final String targetPath) {

        Assert.notNull(targetPath);

        this.redirectTo = targetPath;
    }
}

@@ -30,16 +30,73 @@
 ering;%0A%0A
+import org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A
 import o
@@ -149,16 +149,16 @@
 quired;%0A
-
 import o
@@ -683,24 +683,98 @@
 Pipeline %7B%0A%0A
+    protected final Logger logger = LoggerFactory.getLogger(getClass());%0A%0A
     /**%0A    
@@ -1219,16 +1219,16 @@
 ect.%22);%0A
-
         
@@ -1226,24 +1226,87 @@
 %0A        %7D%0A%0A
+        logger.trace(%22Redirecting to %7B%7D .%22, this.redirectTo);%0A%0A
         resp

Add trace logging to RedirectRenderingPipelineTerminator.