KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > springframework > web > servlet > handler > HandlerInterceptorAdapter


1 /*
2  * Copyright 2002-2006 the original author or authors.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not 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.
15  */

16
17 package org.springframework.web.servlet.handler;
18
19 import javax.servlet.http.HttpServletRequest JavaDoc;
20 import javax.servlet.http.HttpServletResponse JavaDoc;
21
22 import org.springframework.web.servlet.HandlerInterceptor;
23 import org.springframework.web.servlet.ModelAndView;
24
25 /**
26  * Abstract adapter class for the HandlerInterceptor interface,
27  * for simplified implementation of pre-only/post-only interceptors.
28  *
29  * @author Juergen Hoeller
30  * @since 05.12.2003
31  */

32 public abstract class HandlerInterceptorAdapter implements HandlerInterceptor {
33
34     /**
35      * This implementation always returns <code>true</code>.
36      */

37     public boolean preHandle(HttpServletRequest JavaDoc request, HttpServletResponse JavaDoc response, Object JavaDoc handler)
38         throws Exception JavaDoc {
39         return true;
40     }
41
42     /**
43      * This implementation is empty.
44      */

45     public void postHandle(
46             HttpServletRequest JavaDoc request, HttpServletResponse JavaDoc response, Object JavaDoc handler, ModelAndView modelAndView)
47             throws Exception JavaDoc {
48     }
49
50     /**
51      * This implementation is empty.
52      */

53     public void afterCompletion(
54             HttpServletRequest JavaDoc request, HttpServletResponse JavaDoc response, Object JavaDoc handler, Exception JavaDoc ex)
55             throws Exception JavaDoc {
56     }
57
58 }
59
Popular Tags