adobe / aem-core-wcm-components

Standardized components to build websites with AEM.
https://docs.adobe.com/content/help/en/experience-manager-core-components/using/introduction.html
Apache License 2.0
747 stars 753 forks source link

Question on Link API #2873

Open joerghoh opened 1 month ago

joerghoh commented 1 month ago

A question on the Link API (https://github.com/adobe/aem-core-wcm-components/blob/d2a7b02405db241fadbad02a4878f8770b36e246/bundles/core/src/main/java/com/adobe/cq/wcm/core/components/commons/link/Link.java#L4)

What is the difference between getURL() and getMappedURL()? I am asking because getURL() barely makes sense, as it exposes URLs which are never exposed by AEM itself, because the LinkRewriter will always apply rules, for example path shortening.

That means if a mapping /content/foo/:/content/ AEM will never deliver a link to localhost:8080/content/foo/page.html but consistently localhost:8080/content/page.html (even if the LinkImpl will return this value).

Do you see any reason for this?