src/main/java/js/rest/RestServlet.java
private static String key(String requestPath) {
		int queryParametersIndex = requestPath.lastIndexOf('?');
		if (queryParametersIndex == -1) {
			queryParametersIndex = requestPath.length();
		}
		int extensionIndex = requestPath.lastIndexOf('.', queryParametersIndex);
		if (extensionIndex == -1) {
			extensionIndex = queryParametersIndex;
		}
		return requestPath.substring(0, extensionIndex);
	}
private static String key(String requestPath) {
		int queryParametersIndex = requestPath.lastIndexOf('?');
		if (queryParametersIndex == -1) {
			queryParametersIndex = requestPath.length();
		}
		int extensionIndex = requestPath.lastIndexOf('.', queryParametersIndex);
		if (extensionIndex == -1) {
			extensionIndex = queryParametersIndex;
		}
		return requestPath.substring(0, extensionIndex);
	}
Generate retrieval key for REST methods cache. This key is used by request routing logic to locate REST method about to
invoke. It is based on request path extracted from request URI, see {@link RequestPreprocessor} and
{@link RequestContext#getRequestPath()} - and should be identical with storage key.
<p>
Retrieval key syntax is identical with storage key but is based on request path, that on its turn is extracted from
request URI. In fact this method just trim query parameters and extension, if any.

<pre>
request-path = ["/" resource] "/" sub-resource ["?" query-string]
key = ["/" resource ] "/" sub-resource
resource = managed class request-path
sub-resource = managed method request-path
</pre>

@param requestPath request path identify REST resource to retrieve.
@return REST method key.