Resolving the URL at AEM cloud publish | Community
Skip to main content
New Member
November 21, 2023
Solved

Resolving the URL at AEM cloud publish

  • November 21, 2023
  • 2 replies
  • 1149 views

There is a requirement where we need to resolve the Public URL at Publish instance through Servlet. Before this step what we are doing is to get the page Url from the distribution event when distribution completes. I am struggling with the servlet part how to achieve it in AEM as a cloud service.

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 A_H_M_Imrul

Hello @shivamaembackend,

I am not 100% sure about the business that you are trying to tackle, however it seems you want to bind the publish URL with a servlet. I recommend proceeding with servlet binding with resourceTypes. Below is the configuration for binding a servlet with resoruceType(page template in this case)

 

@Component(service = Servlet.class, property = { Constants.SERVICE_DESCRIPTION + "=Servlet for page load", ServletResolverConstants.SLING_SERVLET_METHODS + "=" + HttpConstants.METHOD_GET, ServletResolverConstants.SLING_SERVLET_RESOURCE_TYPES + "=project-name/components/structure/your-page-template" })

 

let me know if this serves you purpose. You can also share more insight on the business you are targeting for better assistance.

 

2 replies

A_H_M_Imrul
Community Advisor
A_H_M_ImrulCommunity AdvisorAccepted solution
Community Advisor
November 21, 2023

Hello @shivamaembackend,

I am not 100% sure about the business that you are trying to tackle, however it seems you want to bind the publish URL with a servlet. I recommend proceeding with servlet binding with resourceTypes. Below is the configuration for binding a servlet with resoruceType(page template in this case)

 

@Component(service = Servlet.class, property = { Constants.SERVICE_DESCRIPTION + "=Servlet for page load", ServletResolverConstants.SLING_SERVLET_METHODS + "=" + HttpConstants.METHOD_GET, ServletResolverConstants.SLING_SERVLET_RESOURCE_TYPES + "=project-name/components/structure/your-page-template" })

 

let me know if this serves you purpose. You can also share more insight on the business you are targeting for better assistance.

 

kautuk_sahni
Community Manager
Community Manager
November 23, 2023

@shivamaembackend Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.

Kautuk Sahni