Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.
SOLVED

Calling Servlet from apps node

Avatar

Level 3

Hi, 

Is it possible to call a slingservlet from any node in crx.

Please find the attached screenshot explaining the requirement.

Thanks

Akshita

1 Accepted Solution

Avatar

Correct answer by
Level 8

Hi,

From what I am aware of, it is better to use resourceTypes to invoke servlets , than from a specific path. There are multiple articles out there , explaining the same.

@SlingServlet(resourceTypes = { "sample/components/page/homepage" }, methods = { "GET" })

View solution in original post

2 Replies

Avatar

Correct answer by
Level 8

Hi,

From what I am aware of, it is better to use resourceTypes to invoke servlets , than from a specific path. There are multiple articles out there , explaining the same.

@SlingServlet(resourceTypes = { "sample/components/page/homepage" }, methods = { "GET" })

Avatar

Employee Advisor

Hi,

can you please elaborate, how you want to call the servlet? Do you want to create a dialog, which calls the servlet?

Jörg