href with jsp external link seems to be not working AEM. | Community
Skip to main content
Level 3
August 4, 2021
Solved

href with jsp external link seems to be not working AEM.

  • August 4, 2021
  • 2 replies
  • 1738 views

Hi,

 

I tried giving an external link with jsp extension in text component (also in button), but the link seems to be broken. Is there any reason for jsp extension is not rendering.

 

I am using AEM as Cloud Service.

 

Thanks,

Divya

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by BrianKasingli

@divyas70997717,

The Link Checker validates both internal links and external links; therefore if the link cannot be resolved by the AEM publisher, then the link can go missing ubt the text link remains.(MABYE the JSP is not whitelisted for the AEM publish server)

External links are validated for syntax and by checking their availability. This check is done asynchronously at a configurable internal. If the Link Checker finds an external link invalid:

  • It is removed from the publisher. The text of the link remains, but the link itself is removed.
  • It is shown as a broken link in the authoring interface.

documentation: https://experienceleague.adobe.com/docs/experience-manager-64/administering/operations/external-link-checker.html?lang=en#external

 

On your local development environment, in the AEM publisher, you can try to disable the link checker, and your links should not be tampered with.

2 replies

BrianKasingli
Community Advisor and Adobe Champion
BrianKasingliCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
August 4, 2021

@divyas70997717,

The Link Checker validates both internal links and external links; therefore if the link cannot be resolved by the AEM publisher, then the link can go missing ubt the text link remains.(MABYE the JSP is not whitelisted for the AEM publish server)

External links are validated for syntax and by checking their availability. This check is done asynchronously at a configurable internal. If the Link Checker finds an external link invalid:

  • It is removed from the publisher. The text of the link remains, but the link itself is removed.
  • It is shown as a broken link in the authoring interface.

documentation: https://experienceleague.adobe.com/docs/experience-manager-64/administering/operations/external-link-checker.html?lang=en#external

 

On your local development environment, in the AEM publisher, you can try to disable the link checker, and your links should not be tampered with.

MarkusBullaAdobe
Adobe Employee
Adobe Employee
August 5, 2021

Hi @divyas70997717!

Is there any specific reason why you would need to have a ".jsp" extension on the public URL?

In general, AEM supports multiple scripting languages, such as HTL, JSP, (server-side) JavaScript. The latest best practice prefer HTL over JSP.

However, the resource and script resolution is not as simple as requesting a resource with a ".jsp" extension to have the according JSP file render the resource. In AEM, there are dedicated handlers based on the extension of the incoming request. There are default handlers, e. g. for ".html", ".json" and other common extensions (implying the method of rendering).You may want to take a look at the "Apache Sling GET Servlet" configuration in your OSGI console to see available renderers.
 
For a better understanding on how URLs (including their extensions) are resolved to certain scripts, please check the Sling documentation on URL to script resolution.

 

If you really need to have the ".jsp" extension on your external, customer facing URLs, you may want to add an "Extension Alias" to the OSGI configuration of the above mentioned "Apache Sling GET Servlet" to have it render ".jsp" extensions similar to ".html" extensions.You would also need to allow this extension in the dispatchers filter rules and probably validate/adjust the LinkChecker configuration.

I wouldn't really recommend this approach, though. I haven't seen a business requirement that can't be handled in a more elegant way.

 

Hope that helps.