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

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

下面列出了org.springframework.web.servlet.HandlerAdapter 类实例代码,或者点击链接到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();
}
 
如果文章对您有帮助,请点击页面广告。以鼓励作者做出的努力。
 类方法
 同包方法