Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

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

Avatar

Level 3

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

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@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...

 

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.

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

@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...

 

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.

Avatar

Employee Advisor

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.