// Path: src/main/java/com/avicit/framework/context/spring/SpringDispatcherContextHolder.java
// public class SpringDispatcherContextHolder {
// 
// 	protected static final Log logger = LogFactory
// 			.getLog(SpringDispatcherContextHolder.class);
// 
// 	private static final ThreadLocal<HttpServletResponse> responseHolder = new NamedThreadLocal<HttpServletResponse>(
// 			"Response Holder");
// 
// 	public static void initDispatcherContext(HttpServletResponse response) {
// 		if (response != null) {
// 			responseHolder.set(response);
// 		}
// 	}
// 
// 	public static void resetDispatcherContext() {
// 		responseHolder.remove();
// 	}
// 
// 	public static HttpServletRequest getRequest() {
// 		return ((ServletRequestAttributes) RequestContextHolder
// 				.getRequestAttributes()).getRequest();
// 	}
// 
// 	public static HttpServletResponse getResponse() {
// 		return responseHolder.get();
// 	}
// 
// 	public static HttpSession getSession() {
// 		return getRequest().getSession();
// 	}
// 
// 	public static ServletContext getServletContext() {
// 		return getSession().getServletContext();
// 	}
// 
// 	/**
// 	 * 获取DispathcerSerlvet的WebApplicationContext，而非全局的
// 	 * **/
// 	public static WebApplicationContext getWebApplicationContext() {
// 		return RequestContextUtils.getWebApplicationContext(getRequest());
// 	}
// 
// 	@SuppressWarnings("unchecked")
// 	public static <T> T getBean(String name) {
// 		return (T) getWebApplicationContext().getBean(name);
// 	}
// 
// 	@SuppressWarnings("unchecked")
// 	public static <T> T getBean(Class<?> clazz) {
// 		return (T)getWebApplicationContext().getBean(clazz);
// 	}
// }
// 
// Path: src/main/java/com/avicit/framework/interceptor/AbstractHandlerPreparInterceptor.java
// public abstract class AbstractHandlerPreparInterceptor  implements HandlerInterceptor{
// 
// 	@Override
// 	public abstract boolean preHandle(HttpServletRequest request,
// 			HttpServletResponse response, Object handler);
// 
// 	@Override
// 	public void postHandle(HttpServletRequest request,
// 			HttpServletResponse response, Object handler,
// 			ModelAndView modelAndView) throws Exception {
// 	}
// 
// 	@Override
// 	public  void afterCompletion(HttpServletRequest request,
// 			HttpServletResponse response, Object handler, Exception ex)
// 			throws Exception{
// 	}
// 	
// }


import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.avicit.framework.context.spring.SpringDispatcherContextHolder;
import com.avicit.framework.interceptor.AbstractHandlerPreparInterceptor;
package com.avicit.framework.interceptor.dispatcher;



public class HandlerDispatcherContextInterceptor extends
		AbstractHandlerPreparInterceptor {

// Path: src/main/java/com/avicit/framework/context/spring/SpringDispatcherContextHolder.java
// public class SpringDispatcherContextHolder {
// 
// 	protected static final Log logger = LogFactory
// 			.getLog(SpringDispatcherContextHolder.class);
// 
// 	private static final ThreadLocal<HttpServletResponse> responseHolder = new NamedThreadLocal<HttpServletResponse>(
// 			"Response Holder");
// 
// 	public static void initDispatcherContext(HttpServletResponse response) {
// 		if (response != null) {
// 			responseHolder.set(response);
// 		}
// 	}
// 
// 	public static void resetDispatcherContext() {
// 		responseHolder.remove();
// 	}
// 
// 	public static HttpServletRequest getRequest() {
// 		return ((ServletRequestAttributes) RequestContextHolder
// 				.getRequestAttributes()).getRequest();
// 	}
// 
// 	public static HttpServletResponse getResponse() {
// 		return responseHolder.get();
// 	}
// 
// 	public static HttpSession getSession() {
// 		return getRequest().getSession();
// 	}
// 
// 	public static ServletContext getServletContext() {
// 		return getSession().getServletContext();
// 	}
// 
// 	/**
// 	 * 获取DispathcerSerlvet的WebApplicationContext，而非全局的
// 	 * **/
// 	public static WebApplicationContext getWebApplicationContext() {
// 		return RequestContextUtils.getWebApplicationContext(getRequest());
// 	}
// 
// 	@SuppressWarnings("unchecked")
// 	public static <T> T getBean(String name) {
// 		return (T) getWebApplicationContext().getBean(name);
// 	}
// 
// 	@SuppressWarnings("unchecked")
// 	public static <T> T getBean(Class<?> clazz) {
// 		return (T)getWebApplicationContext().getBean(clazz);
// 	}
// }
// 
// Path: src/main/java/com/avicit/framework/interceptor/AbstractHandlerPreparInterceptor.java
// public abstract class AbstractHandlerPreparInterceptor  implements HandlerInterceptor{
// 
// 	@Override
// 	public abstract boolean preHandle(HttpServletRequest request,
// 			HttpServletResponse response, Object handler);
// 
// 	@Override
// 	public void postHandle(HttpServletRequest request,
// 			HttpServletResponse response, Object handler,
// 			ModelAndView modelAndView) throws Exception {
// 	}
// 
// 	@Override
// 	public  void afterCompletion(HttpServletRequest request,
// 			HttpServletResponse response, Object handler, Exception ex)
// 			throws Exception{
// 	}
// 	
// }


// Path: src/main/java/com/avicit/framework/interceptor/dispatcher/HandlerDispatcherContextInterceptor.java
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.avicit.framework.context.spring.SpringDispatcherContextHolder;
import com.avicit.framework.interceptor.AbstractHandlerPreparInterceptor;

package com.avicit.framework.interceptor.dispatcher;



public class HandlerDispatcherContextInterceptor extends
		AbstractHandlerPreparInterceptor {

	@Override