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


Java SimpleUrlHandlerMapping.setOrder方法代码示例

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


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

示例1: getHandlerMapping

import org.springframework.web.servlet.handler.SimpleUrlHandlerMapping; //导入方法依赖的package包/类
/**
 * Return a handler mapping with the mapped ViewControllers; or {@code null} in case
 * of no registrations.
 */
public AbstractHandlerMapping getHandlerMapping() {
	Map<String, Object> urlMap = new LinkedHashMap<>();
	for (WebMvcWampWebSocketEndpointRegistration registration : this.registrations) {
		MultiValueMap<HttpRequestHandler, String> mappings = registration
				.getMappings();
		for (HttpRequestHandler httpHandler : mappings.keySet()) {
			for (String pattern : mappings.get(httpHandler)) {
				urlMap.put(pattern, httpHandler);
			}
		}
	}
	SimpleUrlHandlerMapping hm = new SimpleUrlHandlerMapping();
	hm.setUrlMap(urlMap);
	hm.setOrder(this.order);
	if (this.urlPathHelper != null) {
		hm.setUrlPathHelper(this.urlPathHelper);
	}
	return hm;
}
 
开发者ID:ralscha,项目名称:wampspring,代码行数:24,代码来源:WebMvcWampEndpointRegistry.java

示例2: getHandlerMapping

import org.springframework.web.servlet.handler.SimpleUrlHandlerMapping; //导入方法依赖的package包/类
/**
 * Returns a handler mapping with the mapped ViewControllers; or {@code null} in case of no registrations.
 */
protected AbstractHandlerMapping getHandlerMapping() {
	if (registrations.isEmpty()) {
		return null;
	}

	Map<String, Object> urlMap = new LinkedHashMap<String, Object>();
	for (ViewControllerRegistration registration : registrations) {
		urlMap.put(registration.getUrlPath(), registration.getViewController());
	}

	SimpleUrlHandlerMapping handlerMapping = new SimpleUrlHandlerMapping();
	handlerMapping.setOrder(order);
	handlerMapping.setUrlMap(urlMap);
	return handlerMapping;
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:19,代码来源:ViewControllerRegistry.java

示例3: getHandlerMapping

import org.springframework.web.servlet.handler.SimpleUrlHandlerMapping; //导入方法依赖的package包/类
/**
 * Return a handler mapping with the mapped resource handlers; or {@code null} in case of no registrations.
 */
protected AbstractHandlerMapping getHandlerMapping() {
	if (registrations.isEmpty()) {
		return null;
	}

	Map<String, HttpRequestHandler> urlMap = new LinkedHashMap<String, HttpRequestHandler>();
	for (ResourceHandlerRegistration registration : registrations) {
		for (String pathPattern : registration.getPathPatterns()) {
			ResourceHttpRequestHandler requestHandler = registration.getRequestHandler();
			requestHandler.setServletContext(servletContext);
			requestHandler.setApplicationContext(applicationContext);
			urlMap.put(pathPattern, requestHandler);
		}
	}

	SimpleUrlHandlerMapping handlerMapping = new SimpleUrlHandlerMapping();
	handlerMapping.setOrder(order);
	handlerMapping.setUrlMap(urlMap);
	return handlerMapping;
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:24,代码来源:ResourceHandlerRegistry.java

示例4: handlerMappingC

import org.springframework.web.servlet.handler.SimpleUrlHandlerMapping; //导入方法依赖的package包/类
@Bean
public SimpleUrlHandlerMapping handlerMappingC() {
    final SimpleUrlHandlerMapping mapping = new SimpleUrlHandlerMapping();
    mapping.setOrder(1);
    mapping.setAlwaysUseFullPath(true);
    mapping.setRootHandler(rootController());

    final Properties properties = new Properties();
    properties.put("/*.html", new UrlFilenameViewController());
    mapping.setMappings(properties);
    return mapping;
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:13,代码来源:CasManagementWebAppConfiguration.java

示例5: handlerMapping

import org.springframework.web.servlet.handler.SimpleUrlHandlerMapping; //导入方法依赖的package包/类
@Bean
public SimpleUrlHandlerMapping handlerMapping() {
    final SimpleUrlHandlerMapping mapping = new SimpleUrlHandlerMapping();

    final Controller root = rootController();
    mapping.setOrder(1);
    mapping.setAlwaysUseFullPath(true);
    mapping.setRootHandler(root);
    final Map urls = new HashMap();
    urls.put("/", root);

    mapping.setUrlMap(urls);
    return mapping;
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:15,代码来源:CasWebAppConfiguration.java

示例6: handlerMapping

import org.springframework.web.servlet.handler.SimpleUrlHandlerMapping; //导入方法依赖的package包/类
@Bean
public SimpleUrlHandlerMapping handlerMapping() {
    SimpleUrlHandlerMapping mapping = new SimpleUrlHandlerMapping();
    Controller root = this.rootController();
    mapping.setOrder(1);
    mapping.setAlwaysUseFullPath(true);
    mapping.setRootHandler(root);
    Map urls = new HashMap();
    urls.put("/", root);
    mapping.setUrlMap(urls);
    return mapping;
}
 
开发者ID:e-gov,项目名称:TARA-Server,代码行数:13,代码来源:CasWebAppConfiguration.java

示例7: getHandlerMapping

import org.springframework.web.servlet.handler.SimpleUrlHandlerMapping; //导入方法依赖的package包/类
/**
 * Return a handler mapping instance ordered at {@link Integer#MAX_VALUE} containing the
 * {@link DefaultServletHttpRequestHandler} instance mapped to {@code "/**"}; or {@code null} if
 * default servlet handling was not been enabled.
 */
protected AbstractHandlerMapping getHandlerMapping() {
	if (handler == null) {
		return null;
	}

	Map<String, HttpRequestHandler> urlMap = new HashMap<String, HttpRequestHandler>();
	urlMap.put("/**", handler);

	SimpleUrlHandlerMapping handlerMapping = new SimpleUrlHandlerMapping();
	handlerMapping.setOrder(Integer.MAX_VALUE);
	handlerMapping.setUrlMap(urlMap);
	return handlerMapping;
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:19,代码来源:DefaultServletHandlerConfigurer.java

示例8: getHandlerMapping

import org.springframework.web.servlet.handler.SimpleUrlHandlerMapping; //导入方法依赖的package包/类
/**
 * Return a handler mapping with the mapped resource handlers; or {@code null} in case of no registrations.
 */
protected AbstractHandlerMapping getHandlerMapping() {
	if (registrations.isEmpty()) {
		return null;
	}

	Map<String, HttpRequestHandler> urlMap = new LinkedHashMap<String, HttpRequestHandler>();
	for (ResourceHandlerRegistration registration : this.registrations) {
		for (String pathPattern : registration.getPathPatterns()) {
			ResourceHttpRequestHandler handler = registration.getRequestHandler();
			handler.setServletContext(this.servletContext);
			handler.setApplicationContext(this.appContext);
			try {
				handler.afterPropertiesSet();
			}
			catch (Exception e) {
				throw new BeanInitializationException("Failed to init ResourceHttpRequestHandler", e);
			}
			urlMap.put(pathPattern, handler);
		}
	}

	SimpleUrlHandlerMapping handlerMapping = new SimpleUrlHandlerMapping();
	handlerMapping.setOrder(order);
	handlerMapping.setUrlMap(urlMap);
	return handlerMapping;
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:30,代码来源:ResourceHandlerRegistry.java

示例9: urlHandler

import org.springframework.web.servlet.handler.SimpleUrlHandlerMapping; //导入方法依赖的package包/类
@Bean
public SimpleUrlHandlerMapping urlHandler() {
	SimpleUrlHandlerMapping handler = new SimpleUrlHandlerMapping();
	handler.setOrder(Integer.MAX_VALUE - 2);
	Properties mappings = new Properties();
	mappings.put(journal.getContextPath(), "journalController");
	handler.setMappings(mappings);
	return handler;
}
 
开发者ID:Apress,项目名称:pro-spring-boot,代码行数:10,代码来源:JournalAutoConfiguration.java

示例10: faviconHandlerMapping

import org.springframework.web.servlet.handler.SimpleUrlHandlerMapping; //导入方法依赖的package包/类
@Bean
public SimpleUrlHandlerMapping faviconHandlerMapping() {
	SimpleUrlHandlerMapping mapping = new SimpleUrlHandlerMapping();
	mapping.setOrder(Ordered.HIGHEST_PRECEDENCE + 1);
	mapping.setUrlMap(Collections.singletonMap("**/favicon.ico",
			faviconRequestHandler()));
	return mapping;
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:9,代码来源:WebMvcAutoConfiguration.java

示例11: faviconHandlerMapping

import org.springframework.web.servlet.handler.SimpleUrlHandlerMapping; //导入方法依赖的package包/类
@Bean
public SimpleUrlHandlerMapping faviconHandlerMapping() {
	SimpleUrlHandlerMapping mapping = new SimpleUrlHandlerMapping();
	mapping.setOrder(Integer.MIN_VALUE + 1);
	mapping.setUrlMap(Collections.singletonMap("**/favicon.ico",
			faviconRequestHandler()));
	return mapping;
}
 
开发者ID:Nephilim84,项目名称:contestparser,代码行数:9,代码来源:WebMvcAutoConfiguration.java

示例12: sampleServletMapping

import org.springframework.web.servlet.handler.SimpleUrlHandlerMapping; //导入方法依赖的package包/类
/**
 * Tell the Dispatcher Servlet to redirect any requests in the
 * "/messagebroker/" context to the BlazeDS MessageBroker.
 *
 * @return SimpleUrlHandlerMapping instance.
 */
@Bean
public SimpleUrlHandlerMapping sampleServletMapping() {
    SimpleUrlHandlerMapping mapping = new SimpleUrlHandlerMapping();
    mapping.setOrder(Integer.MAX_VALUE - 2);

    Properties urlProperties = new Properties();
    urlProperties.put("/messagebroker/*", "_messageBroker");

    mapping.setMappings(urlProperties);
    return mapping;
}
 
开发者ID:apache,项目名称:flex-blazeds,代码行数:18,代码来源:BlazeDsAutoConfiguration.java

示例13: myFaviconHandlerMapping

import org.springframework.web.servlet.handler.SimpleUrlHandlerMapping; //导入方法依赖的package包/类
@Bean
public SimpleUrlHandlerMapping myFaviconHandlerMapping()
{
    SimpleUrlHandlerMapping mapping = new SimpleUrlHandlerMapping();
    mapping.setOrder(Integer.MIN_VALUE);
    mapping.setUrlMap(Collections.singletonMap("/favicon.ico",
        myFaviconRequestHandler()));
    return mapping;
}
 
开发者ID:IHTSDO,项目名称:MLDS,代码行数:10,代码来源:WebConfigurer.java


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