You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by ni...@apache.org on 2006/02/12 07:58:26 UTC

svn commit: r377142 - /struts/action/trunk/src/java/org/apache/struts/chain/commands/servlet/PerformForward.java

Author: niallp
Date: Sat Feb 11 22:58:25 2006
New Revision: 377142

URL: http://svn.apache.org/viewcvs?rev=377142&view=rev
Log:
Add debug log statement for redirect/forward

Modified:
    struts/action/trunk/src/java/org/apache/struts/chain/commands/servlet/PerformForward.java

Modified: struts/action/trunk/src/java/org/apache/struts/chain/commands/servlet/PerformForward.java
URL: http://svn.apache.org/viewcvs/struts/action/trunk/src/java/org/apache/struts/chain/commands/servlet/PerformForward.java?rev=377142&r1=377141&r2=377142&view=diff
==============================================================================
--- struts/action/trunk/src/java/org/apache/struts/chain/commands/servlet/PerformForward.java (original)
+++ struts/action/trunk/src/java/org/apache/struts/chain/commands/servlet/PerformForward.java Sat Feb 11 22:58:25 2006
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2005 The Apache Software Foundation.
+ * Copyright 2003-2006 The Apache Software Foundation.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -23,6 +23,8 @@
 import org.apache.struts.config.ModuleConfig;
 import org.apache.struts.util.MessageResources;
 import org.apache.struts.util.RequestUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 import javax.servlet.RequestDispatcher;
 import javax.servlet.http.HttpServletRequest;
@@ -31,10 +33,10 @@
  * <p>Perform forwarding or redirection based on the specified
  * <code>ForwardConfig</code> (if any).</p>
  *
- * @version $Rev$ $Date: 2005-11-12 13:01:44 -0500 (Sat, 12 Nov 2005)
- *          $
+ * @version $Rev$ $Date$
  */
 public class PerformForward extends AbstractPerformForward {
+    private static final Log LOG = LogFactory.getLog(PerformForward.class);
     // ------------------------------------------------------- Protected Methods
 
     /**
@@ -77,13 +79,18 @@
             if (uri.startsWith("/")) {
                 uri = request.getContextPath() + uri;
             }
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Redirecting to " + uri);
+            }
 
             sacontext.getResponse().sendRedirect(sacontext.getResponse()
                                                           .encodeRedirectURL(uri));
         } else {
             RequestDispatcher rd =
                 sacontext.getContext().getRequestDispatcher(uri);
-
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Forwarding to " + uri);
+            }
             rd.forward(request, sacontext.getResponse());
         }
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org