01: /*
02: * Copyright 2002-2006 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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;
20: import javax.servlet.http.HttpServletResponse;
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
33: HandlerInterceptor {
34:
35: /**
36: * This implementation always returns <code>true</code>.
37: */
38: public boolean preHandle(HttpServletRequest request,
39: HttpServletResponse response, Object handler)
40: throws Exception {
41: return true;
42: }
43:
44: /**
45: * This implementation is empty.
46: */
47: public void postHandle(HttpServletRequest request,
48: HttpServletResponse response, Object handler,
49: ModelAndView modelAndView) throws Exception {
50: }
51:
52: /**
53: * This implementation is empty.
54: */
55: public void afterCompletion(HttpServletRequest request,
56: HttpServletResponse response, Object handler, Exception ex)
57: throws Exception {
58: }
59:
60: }
|