Hi,

I am using Sling 6 and according to the API (API Version 2.1.0) [1] it
should be possible to call Resource.getName() which provides the last
part of the path as the name of a resource. Like this in my ESP:

var resource = request.getResourceResolver().resolve(resourcePath);
out.print(resource.getName());

However, I am getting

org.mozilla.javascript.EcmaError: TypeError: Cannot find function getName.

The resource is there and I can adapt it to a value map. But for some
reason the getName does not work. I can get the name using the
ResourceUtil class but why not via getName()?

Any ideas?

Best,
 - Fabian

[1] 
http://sling.apache.org/apidocs/sling6/index.html?org/apache/sling/api/resource/Resource.html

--
Fabian
http://twitter.com/fctwitt

Reply via email to