> simply retrieving the workspace name from the locator wasn't my intention.
I'm just using the locator to check whether the request is targeting a workspace resource or not. Is there a better way to do that? The other alternative I considered was using instanceof WorkspaceResource, but that didn't seem any cleaner. Ideally I think we should allow the resource itself to process the HTTP request, but that would require quite a bit of refactoring of the current codebase.
> request ANY dav resource and get back the json-serialization of some other resources.
In the HTTP sense the resource is the one identified by the full URI (e.g. .../default?:path=/node1&path=/node2) instead of just the path part (.../default), so I don't see a fundamental disconnect here. From the perspective of a clean URI space though it would of course be nicer if the multi-read case was better rooted to a single root resource.
One way we could achieve that would be to introduce extra ":include" and ":exclude" patterns for the normal batch-read functionality. Such patterns direct which parts of the subtree rooted at the identified resources should be included in or excluded from the JSON response. For example:
$ curl http://localhost:8080/server/default/jcr:root/path.json?:include=node1&:include=node2
$ curl http://localhost:8080/server/default/jcr:root/.json?:include=path&:exclude=path/node2