You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2011/10/27 15:48:23 UTC
svn commit: r1189760 -
/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/DebugNavigationHandler.java
Author: lofwyr
Date: Thu Oct 27 13:48:22 2011
New Revision: 1189760
URL: http://svn.apache.org/viewvc?rev=1189760&view=rev
Log:
debugging information for wrong AJAX Requests
Modified:
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/DebugNavigationHandler.java
Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/DebugNavigationHandler.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/DebugNavigationHandler.java?rev=1189760&r1=1189759&r2=1189760&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/DebugNavigationHandler.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/DebugNavigationHandler.java Thu Oct 27 13:48:22 2011
@@ -17,16 +17,13 @@ package org.apache.myfaces.tobago.util;
* limitations under the License.
*/
+import org.apache.myfaces.tobago.ajax.AjaxUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.faces.application.NavigationHandler;
import javax.faces.context.FacesContext;
-/*
- * Date: Nov 12, 2006
- * Time: 10:32:39 AM
- */
public class DebugNavigationHandler extends NavigationHandler {
private static final Logger LOG = LoggerFactory.getLogger(DebugNavigationHandler.class);
@@ -37,15 +34,20 @@ public class DebugNavigationHandler exte
this.navigationHandler = navigationHandler;
}
- public void handleNavigation(FacesContext context, String fromAction, String outcome) {
+ public void handleNavigation(FacesContext facesContext, String fromAction, String outcome) {
if (LOG.isDebugEnabled()) {
- LOG.debug("Handle Navigation context: " + context + " fromAction: '"
+ LOG.debug("Handle Navigation context: " + facesContext + " fromAction: '"
+ fromAction + "' outcome: '" + outcome + "'");
}
- navigationHandler.handleNavigation(context, fromAction, outcome);
+
+ if (outcome != null && AjaxUtils.isAjaxRequest(facesContext)) {
+ LOG.warn("An AJAX-Request should not have an outcome set: outcome='" + outcome + "'");
+ }
+
+ navigationHandler.handleNavigation(facesContext, fromAction, outcome);
if (LOG.isDebugEnabled()) {
- LOG.debug("Handled Navigation context: " + context + " fromAction: '"
+ LOG.debug("Handled Navigation context: " + facesContext + " fromAction: '"
+ fromAction + "' outcome: '" + outcome + "'");
}