Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Convert Path to Resourcetype

Avatar

Level 4

Hi All , 

 

I have a servlet ajax call in my JS file using path type  and this JS file is not part of any component but a theme clientlibrary used for one of our child website.

 

I want to convert that servlet path type to resourceType for cloud.

 

How is the best approach to handle such Servlets and how we can convert to resourcetype.

3 Replies

Avatar

Level 5

Hi @Sb2512 

Change the servlet from path to resource type

@SlingServlet(resourceTypes = "myproject/components/structure/ajaxhandler", extensions = "json")

Create Synthetic Resource

In CRXDE or content structure (e.g. /conf or /content):

/conf/mysite/servlets/ajaxhandler
  - sling:resourceType = myproject/components/structure/ajaxhandler

Update JavaScript Call

fetch('/conf/mysite/servlets/ajaxhandler.json')

 

Hope this may helpful.

 

Regards,

Karishma.

Avatar

Level 4

Hi @Karishma_begumSh ,

 

Thanks for the reply.

 

Is there any documentation/example for this.

Also keeping this in /conf or /content which is mutable is recommended ?

 

Avatar

Administrator

@Sb2512 just checking in! Were you able to get this resolved? If one of the replies above helped—whether it completely solved the issue or simply pointed you in the right direction—marking it as accepted can make it much easier for others with the same question to find a solution. And if you found a different way to fix it, sharing your approach would be a great contribution to the community. Your follow-up not only helps close the loop but also ensures others benefit from your experience. Thanks so much for being part of the conversation!



Kautuk Sahni