Skip to main content
Participant
November 12, 2022
Question

Change Post servlet from path to resourceTypes not work properly

  • November 12, 2022
  • 0 replies
  • 117 views

I'm currently migrating codes to AEM cloud.

It's recommended to register servlet with resourceTypes, and I change my servlets from path to resourceTypes, but it doesn't work properly.

E.g.

Change Servlet from sling.servlet.paths to sling.servlet.resourceTypes=bin/pro/getUserType

Add nt:unstructure node at /etc/bin/getUserType with sling:resourType=bin/pro/getUserType

When I test on servlet resolver, my servlet seems always under SlingPostServlet.
When I test on page with localhost:4502/etc/bin/getUserType, with GET, it redirects to localhost:4502/etc/bin/getUserType/ then return proper value; while with POST, always return "Content modified /etc/bin/getUserType"

Could you help check how fix that, and what's the best practice.

This topic has been closed for replies.