final String referer = request.getHeader("referer"); final String resourcePath = new URI(referer).getPath();//gives me short url /test1 ResourceResolver resolver = request.getResourceResolver(); Resource resource = resolver.getResource(resourcePath);// this gives me null
/test1" is getting resolved in /system/console/jcrresolver and this url works in browser.
Views
Replies
Total Likes
check permissions on node /test1.
if you are requesting as anonymous make sure it has necessary access.
awadheshv wrote...
check permissions on node /test1.
if you are requesting as anonymous make sure it has necessary access.
Thank awadheshv, for your response.
If i say that i can access that in browser that mean i have access to this page in anonymous view. In short i double checked that there is no access issues.
Regards,
Amit
Views
Replies
Total Likes
Hi,
I think , First you need to get the resource by passing the "referer" value like - resolver.getResource("referer") then you can get the short url. Since the URL is resolved to Short URL, this resource path will not available when you do getResource.
Hope this makes some sense.
Views
Replies
Total Likes
CQ_learner wrote...
Hi,
I think , First you need to get the resource by passing the "referer" value like - resolver.getResource("referer") then you can get the short url. Since the URL is resolved to Short URL, this resource path will not available when you do getResource.
Hope this makes some sense.
Thanks, I already mentioned that i am getting the short url in my code.
Views
Replies
Total Likes
Views
Likes
Replies