Hi all,
I've a base page component let's say homepage that contains 2 files. one is JSP, another html
is referenced in homepage template. When I try to create a page using that template, it renders html files.
As far as I'm aware of, JSP takes preference over html so it should render JSP instead of html.
Please provide insight.
Regards,
Saurabh Pathak
Solved! Go to Solution.
Views
Replies
Total Likes
Hi Saurabh
Sling Resolution is an important module in Sling. It is really important to understand the sling resolution before even starting AEM development. I have tried to explain the same here for a similar question here Template component can't override page.html . This explains how the files are resolved.
To answer your question simply,
if the user request a content as --> <path>.<selector...>.<extension>
then for the request resolution files ending with <selector>.<extension>.<script extension> takes priority
Always understand that selectors have maximum priority and the more selectors are matched the highest the priority. If selectors are not matched then the extension gets priority.
Here in your case sling priority looks like below
1. homepage.html.jsp
2. homepage.html
3.homepage.jsp
4.GET.html.jsp
5.GET.html
6.GET.jsp
This is best explained in [SLING-387] Simplify script paths and names - ASF JIRA . Please read and let me know if you have more questions. Adding below few more reads for you
Please read the URL decomposition under https://docs.adobe.com/docs/en/aem/6-3/develop/the-basics.html#URL Decomposition
From the above link
Hope this helps you .
Thanks
Veena
Views
Replies
Total Likes
I think extension take precedence. So GET.html will execute
Views
Replies
Total Likes
Between jsp and html first priority goes to jsp as by default a component is linked to jsp at the time of creation.
Here you can see a very clear explanation about sling resolution, selector, extension with examples.
http://www.aemcq5tutorials.com/tutorials/sling-resource-resolution-aem/
Views
Replies
Total Likes
Hi Saurabh
Sling Resolution is an important module in Sling. It is really important to understand the sling resolution before even starting AEM development. I have tried to explain the same here for a similar question here Template component can't override page.html . This explains how the files are resolved.
To answer your question simply,
if the user request a content as --> <path>.<selector...>.<extension>
then for the request resolution files ending with <selector>.<extension>.<script extension> takes priority
Always understand that selectors have maximum priority and the more selectors are matched the highest the priority. If selectors are not matched then the extension gets priority.
Here in your case sling priority looks like below
1. homepage.html.jsp
2. homepage.html
3.homepage.jsp
4.GET.html.jsp
5.GET.html
6.GET.jsp
This is best explained in [SLING-387] Simplify script paths and names - ASF JIRA . Please read and let me know if you have more questions. Adding below few more reads for you
Please read the URL decomposition under https://docs.adobe.com/docs/en/aem/6-3/develop/the-basics.html#URL Decomposition
From the above link
Hope this helps you .
Thanks
Veena
Views
Replies
Total Likes
Hi Saurabh,
See this Adobe's Ask the Community Expert's session(ATCE) session by Lokesh about AEM and Sling.
It was beautifully explained there: ATACE May15 Sling
Hope this helps!
~Ratna.
Views
Replies
Total Likes
HTML will be preferred over JSP .(If they have same file name) Also extension should not be confused as while script selection Selcetor + extension will be the best match and it will be given priority .
So if you are trying localhost//resourcePath/selector1.selector2.extension.
Then Script precedence will be
1 - selector1/Slector2.extension
2 - selector1.extension
3- selector1.(HTML/JSP/ESP/JSON)
4- extension.(HTML/JSP/ESP/JSON)
5- NodeName.(HTML/JSP/ESP/JSON)
6- ResquestType(GET/HEAD).(HTML/JSP/ESP/JSON)
You can Watch This video and provide your valuable input Sling Script Resolution - YouTube
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies