当前位置: 首页>>代码示例>>Java>>正文


Java HandlerAdapter类代码示例

本文整理汇总了Java中org.springframework.web.servlet.HandlerAdapter的典型用法代码示例。如果您正苦于以下问题:Java HandlerAdapter类的具体用法?Java HandlerAdapter怎么用?Java HandlerAdapter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


HandlerAdapter类属于org.springframework.web.servlet包,在下文中一共展示了HandlerAdapter类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: extractAdapters

import org.springframework.web.servlet.HandlerAdapter; //导入依赖的package包/类
private List<HandlerAdapter> extractAdapters() {
	List<HandlerAdapter> list = new ArrayList<HandlerAdapter>();
	list.addAll(this.beanFactory.getBeansOfType(HandlerAdapter.class).values());
	list.remove(this);
	AnnotationAwareOrderComparator.sort(list);
	return list;
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:8,代码来源:EndpointWebMvcChildContextConfiguration.java

示例2: supports

import org.springframework.web.servlet.HandlerAdapter; //导入依赖的package包/类
@Override
public boolean supports(Object handler) {
	if (this.adapters == null) {
		this.adapters = extractAdapters();
	}
	for (HandlerAdapter mapping : this.adapters) {
		if (mapping.supports(handler)) {
			return true;
		}
	}
	return false;
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:13,代码来源:EndpointWebMvcChildContextConfiguration.java

示例3: handle

import org.springframework.web.servlet.HandlerAdapter; //导入依赖的package包/类
@Override
public ModelAndView handle(HttpServletRequest request,
		HttpServletResponse response, Object handler) throws Exception {
	if (this.adapters == null) {
		this.adapters = extractAdapters();
	}
	for (HandlerAdapter mapping : this.adapters) {
		if (mapping.supports(handler)) {
			return mapping.handle(request, response, handler);
		}
	}
	return null;
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:14,代码来源:EndpointWebMvcChildContextConfiguration.java

示例4: getLastModified

import org.springframework.web.servlet.HandlerAdapter; //导入依赖的package包/类
@Override
public long getLastModified(HttpServletRequest request, Object handler) {
	if (this.adapters == null) {
		this.adapters = extractAdapters();
	}
	for (HandlerAdapter mapping : this.adapters) {
		if (mapping.supports(handler)) {
			return mapping.getLastModified(request, handler);
		}
	}
	return 0;
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:13,代码来源:EndpointWebMvcChildContextConfiguration.java

示例5: handlerAdaptersCreated

import org.springframework.web.servlet.HandlerAdapter; //导入依赖的package包/类
@Test
public void handlerAdaptersCreated() throws Exception {
	load();
	assertThat(this.context.getBeanNamesForType(HandlerAdapter.class).length)
			.isEqualTo(3);
	assertThat(this.context.getBean(RequestMappingHandlerAdapter.class)
			.getMessageConverters()).isNotEmpty()
					.isEqualTo(this.context.getBean(HttpMessageConverters.class)
							.getConverters());
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:11,代码来源:WebMvcAutoConfigurationTests.java

示例6: getHandlerAdapter

import org.springframework.web.servlet.HandlerAdapter; //导入依赖的package包/类
@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());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:15,代码来源:KSBDispatcherServlet.java

示例7: handlerAdaptersCreated

import org.springframework.web.servlet.HandlerAdapter; //导入依赖的package包/类
@Test
public void handlerAdaptersCreated() throws Exception {
	load();
	assertEquals(3, this.context.getBeanNamesForType(HandlerAdapter.class).length);
	assertFalse(this.context.getBean(RequestMappingHandlerAdapter.class)
			.getMessageConverters().isEmpty());
	assertEquals(this.context.getBean(HttpMessageConverters.class).getConverters(),
			this.context.getBean(RequestMappingHandlerAdapter.class)
					.getMessageConverters());
}
 
开发者ID:Nephilim84,项目名称:contestparser,代码行数:11,代码来源:WebMvcAutoConfigurationTests.java

示例8: preHandle

import org.springframework.web.servlet.HandlerAdapter; //导入依赖的package包/类
/**
 * @see HandlerInterceptor#preHandle(HttpServletRequest,HttpServletResponse, Object)
 */
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception
{

    if (request.getParameter(TableTagParameters.PARAMETER_EXPORTING) == null)
    {
        if (log.isDebugEnabled())
        {
            log.debug(Messages.getString("ResponseOverrideFilter.parameternotfound")); //$NON-NLS-1$
        }
        // don't intercept!
        return true;
    }

    BufferedResponseWrapper wrapper = new BufferedResponseWrapper13Impl(response);

    Map<String, Boolean> contentBean = new HashMap<String, Boolean>(4);
    if (buffer)
    {
        contentBean.put(TableTagParameters.BEAN_BUFFER, Boolean.TRUE);
    }
    request.setAttribute(TableTag.FILTER_CONTENT_OVERRIDE_BODY, contentBean);

    if (log.isDebugEnabled())
    {
        log.debug("handler is " + handler);
    }

    HandlerAdapter handlerAdaptor = new SimpleControllerHandlerAdapter();
    handlerAdaptor.handle(request, wrapper, handler);

    ExportDelegate.writeExport(response, request, wrapper);

    return false;
}
 
开发者ID:webbfontaine,项目名称:displaytag,代码行数:39,代码来源:DisplayTagSpringInterceptor.java

示例9: handlerAdapter

import org.springframework.web.servlet.HandlerAdapter; //导入依赖的package包/类
@Bean
public HandlerAdapter handlerAdapter() {
	return new RequestMappingHandlerAdapter();
}
 
开发者ID:tanhaichao,项目名称:leopard,代码行数:5,代码来源:TrynbConfiguration.java

示例10: handlerAdapter

import org.springframework.web.servlet.HandlerAdapter; //导入依赖的package包/类
@Bean
public HandlerAdapter handlerAdapter() {
    return new RequestMappingHandlerAdapter();
}
 
开发者ID:awslabs,项目名称:aws-serverless-java-container,代码行数:5,代码来源:PetStoreSpringAppConfig.java

示例11: handler

import org.springframework.web.servlet.HandlerAdapter; //导入依赖的package包/类
@Bean
HandlerAdapter handler(){
	RequestMappingHandlerAdapter a = new RequestMappingHandlerAdapter();
	return a;
}
 
开发者ID:danidemi,项目名称:jlubricant,代码行数:6,代码来源:SpringMvcAndSecurity.java


注:本文中的org.springframework.web.servlet.HandlerAdapter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。