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 2009/06/17 16:38:30 UTC

svn commit: r785628 - in /myfaces/tobago/trunk/example/test/src/main/java/org: ./ apache/ apache/myfaces/ apache/myfaces/tobago/ apache/myfaces/tobago/example/ apache/myfaces/tobago/example/test/

Author: lofwyr
Date: Wed Jun 17 14:38:29 2009
New Revision: 785628

URL: http://svn.apache.org/viewvc?rev=785628&view=rev
Log:
testing webapp:
 - Ensures that the application for this user is running in debug mode.

Added:
    myfaces/tobago/trunk/example/test/src/main/java/org/   (with props)
    myfaces/tobago/trunk/example/test/src/main/java/org/apache/
    myfaces/tobago/trunk/example/test/src/main/java/org/apache/myfaces/
    myfaces/tobago/trunk/example/test/src/main/java/org/apache/myfaces/tobago/
    myfaces/tobago/trunk/example/test/src/main/java/org/apache/myfaces/tobago/example/
    myfaces/tobago/trunk/example/test/src/main/java/org/apache/myfaces/tobago/example/test/
    myfaces/tobago/trunk/example/test/src/main/java/org/apache/myfaces/tobago/example/test/DebugModePhaseListener.java

Propchange: myfaces/tobago/trunk/example/test/src/main/java/org/
------------------------------------------------------------------------------
    svn:mergeinfo = 

Added: myfaces/tobago/trunk/example/test/src/main/java/org/apache/myfaces/tobago/example/test/DebugModePhaseListener.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/test/src/main/java/org/apache/myfaces/tobago/example/test/DebugModePhaseListener.java?rev=785628&view=auto
==============================================================================
--- myfaces/tobago/trunk/example/test/src/main/java/org/apache/myfaces/tobago/example/test/DebugModePhaseListener.java (added)
+++ myfaces/tobago/trunk/example/test/src/main/java/org/apache/myfaces/tobago/example/test/DebugModePhaseListener.java Wed Jun 17 14:38:29 2009
@@ -0,0 +1,42 @@
+package org.apache.myfaces.tobago.example.test;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.myfaces.tobago.context.ClientProperties;
+
+import javax.faces.event.PhaseEvent;
+import javax.faces.event.PhaseId;
+import javax.faces.event.PhaseListener;
+
+/**
+ * Ensures that the application for this user is running in debug mode.
+ */
+public class DebugModePhaseListener implements PhaseListener {
+
+  public void afterPhase(PhaseEvent event) {
+  }
+
+  public void beforePhase(PhaseEvent event) {
+    ClientProperties client = ClientProperties.getInstance(event.getFacesContext());
+    client.setDebugMode(true);
+  }
+
+  public PhaseId getPhaseId() {
+    return PhaseId.RENDER_RESPONSE;
+  }
+}