The RequestResolver
, to quote the javadoc, defines the service API which may be used to resolve Resource
objects.
You typically access it in a SlingServlet
by calling request.getResourceResolver()
or in a script ( JSP script for instance ) under the resourceResolver
variable. For more details on variables on scripts see Scripting variables in the Sling wiki.
One you get a hold of it you can use it to access resources in the content tree:
Resource resource = requestResolver.getResource("/content/my/resource");
if ( resource != null ) // bingo!
To display a resource's properties I usually adapt it to a ValueMap
and then extract the properties
ValueMap properties = resource.adaptTo(ValueMap.class);
String title = properties.get("jcr:title", String.class);