Example usage for org.springframework.web.servlet.handler SimpleUrlHandlerMapping setUrlPathHelper

List of usage examples for org.springframework.web.servlet.handler SimpleUrlHandlerMapping setUrlPathHelper

Introduction

In this page you can find the example usage for org.springframework.web.servlet.handler SimpleUrlHandlerMapping setUrlPathHelper.

Prototype

public void setUrlPathHelper(UrlPathHelper urlPathHelper) 

Source Link

Document

Set the UrlPathHelper to use for resolution of lookup paths.

Usage

From source file:ch.rasc.wampspring.config.WebMvcWampEndpointRegistry.java

/**
 * Return a handler mapping with the mapped ViewControllers; or {@code null} in case
 * of no registrations.//from www .ja  v  a2  s .  c  om
 */
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;
}