How are the URIs mapped at the server?

First, the web-server will match the beginning of the requested URI against the prefixes of all contexts (web-applications).If no context matches, it will use the default context instead.