@Bean public HandlerMapping landingPageHandlerMapping() { SimpleUrlHandlerMapping mapping = new SimpleUrlHandlerMapping(); mapping.setOrder(0); ParameterizableViewController pvc = new ParameterizableViewController(); pvc.setViewName("loginPage"); mapping.setUrlMap(Collections.singletonMap("/login", pvc)); return mapping; }
@Bean public SimpleUrlHandlerMapping handlerMapping() { final SimpleUrlHandlerMapping mapping = new SimpleUrlHandlerMapping(); mapping.setOrder(1); mapping.setAlwaysUseFullPath(true); mapping.setRootHandler(rootController()); final Map urls = new HashMap(); urls.put("/", rootController()); mapping.setUrlMap(urls); return mapping; }
@Bean public SimpleUrlHandlerMapping handlerMapping() { SockJsService sockJsService = new DefaultSockJsService(sockJsTaskScheduler()); Map<String, Object> urlMap = new HashMap<String, Object>(); urlMap.put( "/sockjs/connector/**", new SockJsHttpRequestHandler(sockJsService, echoWebSocketHandler())); SimpleUrlHandlerMapping hm = new SimpleUrlHandlerMapping(); hm.setOrder(2); hm.setUrlMap(urlMap); return hm; }
@Bean public HandlerMapping viewControllerHandlerMapping() { SimpleUrlHandlerMapping mapping = new SimpleUrlHandlerMapping(); mapping.setOrder(2); Map<String, String> jspMapping = jspMapping().getConfig(); Map<String, ParameterizableViewController> jspViewBeans = new HashMap<>(); ParameterizableViewController controller; for (String url : jspMapping.keySet()) { controller = new ParameterizableViewController(); controller.setViewName(jspMapping.get(url)); jspViewBeans.put(url, controller); } mapping.setUrlMap(jspViewBeans); return mapping; }