本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}