MultiUriTemplateUtil { public static String expandWithMultiVariable( String requestPath, String matchingPatternPath, String variableName, String value, String valueSeparator){ Map<String, String> map = UriTemplateUtil.extractUriTemplateVariables(requestPath, matchingPatternPath); return expandWithMultiVariable(matchingPatternPath, map, variableName, value, valueSeparator); } private  MultiUriTemplateUtil(); static String expandBestMatchingPatternMulti(HttpServletRequest request,String variableName,String value,String valueSeparator); static String expandWithMultiVariable(
                    String requestPath,
                    String matchingPatternPath,
                    String variableName,
                    String value,
                    String valueSeparator); static String expandWithMultiVariable(
                    String matchingPatternPath,
                    Map<String, String> map,
                    String variableName,
                    String value,
                    String valueSeparator); static String removeMultiVariableValue(
                    String requestPath,
                    String matchingPatternPath,
                    String variableName,
                    String value,
                    String valueSeparator);  }
@Test public void testExpandWithMultiVariable2(){ String requestPath = "/s/c-m-c-s-k-s100,200-o.htm"; String matchingPatternPath = "/s/c{categoryCode}-m{material}-c{color}-s{size}-k{kind}-s{style}-o{order}.htm"; String variableName = "style"; String value = "Lifestyle / Graphic"; String valueSeparator = "@"; LOGGER.debug(MultiUriTemplateUtil.expandWithMultiVariable(requestPath, matchingPatternPath, variableName, value, valueSeparator)); }
@Test public void testExpandWithMultiVariable(){ String requestPath = "/s/c-m-c-s-k-s100-o.htm"; String matchingPatternPath = "/s/c{categoryCode}-m{material}-c{color}-s{size}-k{kind}-s{style}-o{order}.htm"; String variableName = "style"; String value = "Lifestyle / Graphic"; String valueSeparator = ","; LOGGER.debug(MultiUriTemplateUtil.expandWithMultiVariable(requestPath, matchingPatternPath, variableName, value, valueSeparator)); }
@Test public void expandWithMultiVariableMap(){ String matchingPatternPath = "/s/c{categoryCode}-m{material}-c{color}-s{size}-k{kind}-s{style}-o{order}.htm"; Map<String, String> map = toMap("categoryCode", "2541", "style", "100"); String variableName = "style"; String value = URIUtil.encode("Lifestyle / Graphic", UTF8); String valueSeparator = ","; LOGGER.debug(MultiUriTemplateUtil.expandWithMultiVariable(matchingPatternPath, map, variableName, value, valueSeparator)); }