Different way of calling the custom servlet in AEM
Hello Team,
In my application, customServlet has these details:
@Component(service = Servlet.class, property = { "sling.servlet.resourceTypes=" + "/apps/abc/mycustomName",
"sling.servlet.methods=GET" }, immediate = true)
public class customServletName extends SlingSafeMethodsServlet { ....
}
In a javascript method, below code is written to call the custom Servlet.
$.ajax({
url: "/content/data/abc/servlet/mynode",
type: "GET",
// other necessary details
});
/content/data/abc/servlet/mynode This is the jcr node, which has sling:resourceType as /apps/abc/mycustomName
Instead of this, in the js method, I can call directly url: "/apps/abc/mycustomName" Why above approach is used? is it known as Proxy servlet? I am bit confused. Could you please give me some clarity?
cc @aanchal-sikka @joerghoh @briankasingli
-Thanks