Kauri Documentation
 PreviousHomeNext 
6.8 Spring integrationBook Index6.10 Routing reference

6.9 URI template syntax

Routers in Restlet and Kauri match URIs based on URI templates.

A URI template is basically a string containing named wildcards, called variables, between { and }. An example:

/users/{id}

By default, the variable {id} will only match URI segments, basically any text not containing the slash character.

You can define various options for the variables. The options are specified by adding them comma-separated after the variable name: {var,option1,option2,option3}.

The options are (in sequence of usefulness):

The options can be specified in any order. It does not make sense to specify multiple variable type options.

For example, to decode a variable and match all URI path characters (thus possibly multiple path segments), use:

/users/{id,uri_path,decode}

Variable types

Option name

Description

all

Matches all characters.

alpha

Matches all alphabetical characters.

alpha_digit

Matches all alphabetical and digital characters.

comment

Matches any TEXT excluding "(" and ")".

comment_attribute

Matches any TEXT inside a comment excluding ";".

digit

Matches all digital characters.

token

Matches any CHAR except CTLs or separators.

uri_all

Matches all URI characters.

uri_fragment

Matches URI fragment characters.

uri_path

Matches URI path characters (not the query or the fragment parts).

uri_query

Matches URI query characters.

uri_scheme

Matches URI scheme characters.

uri_segment

Matches URI segment characters.

uri_unreserved

Matches unreserved URI characters.

word

Matches all alphabetical and digital characters plus the underscore.

 PreviousHomeNext 
6.8 Spring integration6.10 Routing reference