When the request url is lets say /content/myapp.html and sling:resourceType of myapp is /apps/myapp/components/myappcomponent.
Scenario 1: under myappcomponent, lets say there are following files myappcomponent.html, myappcomponent.esp
In this case myappcomponent.html will be rendered.
Scenario 2: under myappcomponent, lets say there are following files myappcomponent.esp
In this case myappcomponent.esp will be rendered.
Scenario 3: under myappcomponent, lets say there are following files myappcomponent.json,myappcomponent.js,myappcomponent.txt
what will be rendered in this case????????
Question: is there any other fallback extensions which are supported in Sling if there is no applicable extension which is requested?
Solved! Go to Solution.
Views
Replies
Total Likes
Refer these link you will have idea about sling/sling framework & sling-resource-resolution -
https://sling.apache.org/documentation/the-sling-engine/url-decomposition.html
http://www.aemcq5tutorials.com/tutorials/sling-resource-resolution-aem/
@manjunathdj I searched SLING and ADOBE Documentations as well, not found it anywhere.
@Prashanth_02a - Are you looking to render Json or JS files?
@manjunathdj @I want to understand sling uri resolution
Refer these link you will have idea about sling/sling framework & sling-resource-resolution -
https://sling.apache.org/documentation/the-sling-engine/url-decomposition.html
http://www.aemcq5tutorials.com/tutorials/sling-resource-resolution-aem/
various script engines are supported:
.html
.esp, .ecma
.jsp
.java
.jst
@Prashanth_02a Please see below link for an example. Ideally combination of selector and extensions takes the highest priority. Same has been explained in this link:
https://aemgeeks.wordpress.com/2017/07/31/sling-resource-resolution-sling-request-processing/#:~:tex...).
@krati_garg This example is demonstrating only .html and .esp as I mentioned in my query, not others.
selectors have maximum priority and the more selectors are matched the highest the priority. If selectors are not matched then the extension gets priority.
It follows the below pattern:
{resourceTypeLabel}.{selectorString}.{requestMethod}.{requestExtension}.{scriptExtension}
for more details ref. https://issues.apache.org/jira/browse/SLING-387
Hope this helps.
@Manu_Mathew_ @This example is demonstrating only .html and .esp as I mentioned in my query, not others
For Scenario 3: I believe none of them will render.
As far as I remember jsp,esp,html are suppported.
for all other than html - the suffix is added to the script name
eg:
/myappcomponent.js.esp
/myappcomponent.json.esp
/myappcomponent.txt.esp
Have you already tried it out?
You will get a 404 if
* you are requesting a non-existing content node
* if a resourcetype is given but does not exist
Views
Likes
Replies
Views
Likes
Replies