KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > roller > ui > core > filters > DebugFilter


1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. The ASF licenses this file to You
4 * under the Apache License, Version 2.0 (the "License"); you may not
5 * use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License. For additional information regarding
15 * copyright in this work, please see the NOTICE file in the top level
16 * directory of this distribution.
17 */

18 /*
19  * DebugFilter.java
20  *
21  * Created on April 17, 2006, 10:30 AM
22  */

23
24 package org.apache.roller.ui.core.filters;
25
26 import java.io.IOException JavaDoc;
27 import javax.servlet.Filter JavaDoc;
28 import javax.servlet.FilterChain JavaDoc;
29 import javax.servlet.FilterConfig JavaDoc;
30 import javax.servlet.ServletException JavaDoc;
31 import javax.servlet.ServletRequest JavaDoc;
32 import javax.servlet.ServletResponse JavaDoc;
33 import javax.servlet.http.HttpServletRequest JavaDoc;
34 import javax.servlet.http.HttpServletResponse JavaDoc;
35 import org.apache.commons.logging.Log;
36 import org.apache.commons.logging.LogFactory;
37
38
39 /**
40  * A simple debugging filter.
41  *
42  * This filter is NOT mapped by default and is here only for Roller developers
43  * to use while they are working on the code and debugging things.
44  *
45  * @web.filter name="DebugFilter"
46  */

47 public class DebugFilter implements Filter JavaDoc {
48     
49     private static Log log = LogFactory.getLog(DebugFilter.class);
50     
51     
52     public void doFilter(ServletRequest JavaDoc req, ServletResponse JavaDoc res, FilterChain JavaDoc chain)
53             throws IOException JavaDoc, ServletException JavaDoc {
54         
55         HttpServletRequest JavaDoc request = (HttpServletRequest JavaDoc) req;
56         HttpServletResponse JavaDoc response = (HttpServletResponse JavaDoc) res;
57         
58         log.info("ENTERING "+request.getRequestURL());
59         
60         chain.doFilter(request, response);
61         
62         log.info("EXITING "+request.getRequestURL());
63     }
64     
65     
66     public void destroy() {}
67     
68     
69     public void init(FilterConfig JavaDoc filterConfig) {}
70     
71 }
72
Popular Tags