Need some suggestion on one of the scenario for sling servlet in AEM.
In AEM we can call servlet via AJAX call in javascript, and can specify the requested path in ajax like : "type: 'POST',
url:'/bin/calculatorServlet', "In sightly itself, in form action i can specify the path of servlet like "/bin/myservlet" to invoke.
Just wondering if someone can tell what approach we should use to call a sling servlet and what are the benifits of using one above another.
what i understand is if we require the output from servlet, we can get in ajax response and process.