We want to call a servlet using an AJAX GET request. Our servlet path is something like /content/test/jcr:content/par-main/events_calendar.events.json. We use resource type as a way of resolving the servlet so we can read properties from the component within the servlet itself.
Is there a way to prevent exposing the full content structure in the HTML/Javascript?
Is it considered OK to expose - /content/test0/jcr:content/par-main/ in our HTML?
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
When your page is at https://hostname/home/mypage.html, I would do the AJAX request on https://hostname/home/mypage.events.json. Don't expose the internal repo path.
kind regards,
Jörg
Views
Replies
Total Likes
If you are using web server, you may be able to do it using mod_rewrite. You need to write rules in apache configuration, you may have to call the path defined in rules.
Views
Replies
Total Likes
Hi,
When your page is at https://hostname/home/mypage.html, I would do the AJAX request on https://hostname/home/mypage.events.json. Don't expose the internal repo path.
kind regards,
Jörg
Views
Replies
Total Likes
Jörg Hoh wrote...
Hi,
When your page is at https://hostname/home/mypage.html, I would do the AJAX request on https://hostname/home/mypage.events.json. Don't expose the internal repo path.
kind regards,
Jörg
I totally agree hiding the path e.g. /content/my-site/en should be done. But hiding the path from the page downwards e.g. my-page/jcr-content/par-main/events.calendar.json - is this required?
A lot of AJAX examples I have seen don't seem to be hiding this path - Example - http://labs.sixdimensions.com/blog/2013-09-16/using-ajax-cq-components/
$.get("/my-page/jcr:content/my-component.{selector}.html?{url-param}={param-value}") .success(function(data){ $("component-id").replaceWith($(data)); });
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies