You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by ta...@apache.org on 2006/03/01 00:02:27 UTC
svn commit: r381807 - in /portals/jetspeed-2/trunk:
components/portal/src/java/org/apache/jetspeed/engine/JetspeedServlet.java
components/portal/src/java/org/apache/jetspeed/pipeline/valve/impl/DebugValveImpl.java
src/webapp/WEB-INF/assembly/pipelines.xml
Author: taylor
Date: Tue Feb 28 15:02:21 2006
New Revision: 381807
URL: http://svn.apache.org/viewcvs?rev=381807&view=rev
Log:
optional debug valve
Added:
portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/pipeline/valve/impl/DebugValveImpl.java
Modified:
portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/engine/JetspeedServlet.java
portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/pipelines.xml
Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/engine/JetspeedServlet.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/engine/JetspeedServlet.java?rev=381807&r1=381806&r2=381807&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/engine/JetspeedServlet.java (original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/engine/JetspeedServlet.java Tue Feb 28 15:02:21 2006
@@ -283,20 +283,7 @@
firstInit = true;
log.info("Done shutting down!");
- }
-
- private void debugHeaders( HttpServletRequest req )
- {
- java.util.Enumeration e = req.getHeaderNames();
- while (e.hasMoreElements())
- {
- String name = (String) e.nextElement();
- String value = req.getHeader(name);
- System.out.println("name = " + name);
- System.out.println("value = " + value);
- }
- }
-
+ }
/**
* If you prefer to use a component manager other than Spring, you
Added: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/pipeline/valve/impl/DebugValveImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/pipeline/valve/impl/DebugValveImpl.java?rev=381807&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/pipeline/valve/impl/DebugValveImpl.java (added)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/pipeline/valve/impl/DebugValveImpl.java Tue Feb 28 15:02:21 2006
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2000-2004 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.
+ * 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.
+ */
+package org.apache.jetspeed.pipeline.valve.impl;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jetspeed.pipeline.PipelineException;
+import org.apache.jetspeed.pipeline.valve.AbstractValve;
+import org.apache.jetspeed.pipeline.valve.ValveContext;
+import org.apache.jetspeed.request.RequestContext;
+
+/**
+ * <p>
+ * Debug Valve
+ * </p>
+ *
+ * @author <a href="mailto:weaver@apache.org">Scott T. Weaver</a>
+ * @version $Id: $
+ *
+ */
+public class DebugValveImpl extends AbstractValve
+{
+ private static final Log log = LogFactory.getLog(DebugValveImpl.class);
+
+ public DebugValveImpl()
+ {
+ }
+
+ public void invoke(RequestContext request, ValveContext context) throws PipelineException
+ {
+ debugHeaders(request.getRequest());
+ context.invokeNext(request);
+ }
+
+ /**
+ * @see java.lang.Object#toString()
+ */
+ public String toString()
+ {
+ return "DebugValveImpl";
+ }
+
+ private void debugHeaders( HttpServletRequest req )
+ {
+ log.info("-- Jetspeed Debug Valve: Debugging standard headers --");
+ java.util.Enumeration e = req.getHeaderNames();
+ while (e.hasMoreElements())
+ {
+ String name = (String) e.nextElement();
+ String value = req.getHeader(name);
+ log.info("http header = " + name + " : " + value);
+ System.out.println("http header = " + name + " : " + value);
+ }
+ }
+}
\ No newline at end of file
Modified: portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/pipelines.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/pipelines.xml?rev=381807&r1=381806&r2=381807&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/pipelines.xml (original)
+++ portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/pipelines.xml Tue Feb 28 15:02:21 2006
@@ -312,5 +312,9 @@
</map>
</constructor-arg>
</bean>
-
+
+ <bean id="debugValve"
+ class="org.apache.jetspeed.pipeline.valve.impl.DebugValveImpl"
+ />
+
</beans>
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org