During the Resource Resolution step, the client request URI (as being returned by [HttpServletRequest.getRequestURI()](http://docs.oracle.com/javaee/6/api/javax/servlet/http/HttpServletRequest.html#getRequestURI())) is decomposed into the following parts (in exactly this order):
.) or it is the full request URI. Otherwise (for a path not matching any existing resource) the resource path ends at the first dot (
.) in the request url. The exact logic for retrieving the resource path is implemented at ResourceResolver.resolve(HttpServletRequest,String). It is impossible to tell from just looking at the request URI where the resource path part ends. You have to know the underlying resource structure to know how a URL is decomposed. You cannot safely assume that the resource path will always end at the first dot!.
.), the string after the dot up to but not including the last dot before the next slash character or the end of the request URL comprises the selectors. If the resource path spans the complete request URL no selectors exist. If only one dot follows the resource path before the end of the request URL or the next slash, also no selectors exist.
Those decomposed parts can be accessed through the
RequestPathInfo object, which is retrieved via SlingHttpServletRequest.getPathInfo().
There's a cheat sheet in Adobe's AEM documentation at https://docs.adobe.com/docs/en/aem/6-2/develop/platform/sling-cheatsheet.html available to get you familiar with the URL decomposition of Sling.
Assume there is a Resource at
/a/b, which has no children.
|URI||Resource Path||Selectors||Extension||Suffix||Resource Found|
The tests at
Feel free to suggest additional tests that help clarify how this works!