类org.springframework.web.servlet.HandlerAdapter源码实例Demo

下面列出了怎么用org.springframework.web.servlet.HandlerAdapter的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: rice   文件: KSBDispatcherServlet.java
@Override
protected HandlerAdapter getHandlerAdapter(Object handler) throws ServletException {
	if (handler instanceof HttpRequestHandler) {
		return new HttpRequestHandlerAdapter();
	} else if (handler instanceof Controller) {
		Object unwrappedHandler = ClassLoaderUtils.unwrapFromProxy(handler);
		if (unwrappedHandler instanceof CXFServletControllerAdapter) {
			// TODO this just seems weird as this controller is initially null when it's created, does there need to be some synchronization here?
			((CXFServletControllerAdapter)unwrappedHandler).setController(cxfServletController);
		}			
		return new SimpleControllerHandlerAdapter();
	}
	throw new RiceRuntimeException("handler of type " + handler.getClass().getName() + " is not known and can't be used by " + KSBDispatcherServlet.class.getName());
}
 
@Bean
public HandlerAdapter handlerAdapter() {
    return new RequestMappingHandlerAdapter();
}
 
@Bean
public HandlerAdapter handlerAdapter() {
    return new RequestMappingHandlerAdapter();
}
 
@Bean
public HandlerAdapter handlerAdapter() {
    return new RequestMappingHandlerAdapter();
}
 
@Bean
public HandlerAdapter handlerAdapter() {
    return new RequestMappingHandlerAdapter();
}
 
@Bean
public HandlerAdapter handlerAdapter() {
    return new RequestMappingHandlerAdapter();
}
 
 同包方法