Fork me on GitHub Fork me on GitHub

URIMatcher


<%
var uriMatcher = new URIMatcher(request.getRequestURI());
 
//Provide a pattern to be matched against the URL
if(uriMatcher.match('/{dir0}/{page}')) {
    //If pattern matches, elements can be accessed from their keys
    print("dir0 element is : " + uriMatcher.elements().dir0)
}
%>

Overview

URIMatcher provides the functionality of comparing a given uri with a template. This API function will be useful for REST service composition


Operations

Member Returns Description
URIMatcher(uri)URIMatcher ObjectReturns the URIMatcher Object

var uriMatcher = new URIMatcher(request.uri);
match(pattern)BooleanReturns the bolean for matched

uriMatcher.match('/{context}/{dir}/{page}');
elements()Objectreturns the set of elements, which were matched with the provided uri, and provided template

uriMatcher.elements();