Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.

Sightly issue with URLs if it doesn't have .html extension

Avatar

Level 3

Hello everyone,

I have a URL for example "http://help-forums.adobe.com/content/adobeforums:test/" when I provide this URL in href, the output that i get is "http://help-forums.adobe.com/content/_adobeforums_test/". 

More Details:

Suppose properties.link = http://help-forums.adobe.com/content/adobeforums:test/

<a href="${properties.link @ context='unsafe'}">Support </a> //this doesn't work

but if i append .html at the end of the URL it works.

<a href="${properties.link @ context='unsafe'}.html">Support </a> //this works

Why doesn't it work when we don't have .html in the URL?

3 Replies

Avatar

Employee

This is Sling related, with the extension you basically point how you want to render the content.

Avatar

Administrator

As correctly pointed by Feike, 

This is sling resolution, please have a look at this URL to Script Resolution documentation :-

Link:- https://docs.adobe.com/docs/en/aem/6-2/develop/the-basics.html

[img]https://docs.adobe.com/content/docs/en/aem/6-2/develop/the-basics/_jcr_content/contentbody/image_1.i...

 

Preference order is Selector + Extention > Selector > Extention > Method of call (get,post etc).

~kautuk



Kautuk Sahni

Avatar

Employee Advisor

Hi,

if the question about the ":" character: This character is special and if it's encountered the namespace mangling of Sling kicks in and translates it into "_namespace_".