0

Need some suggestion on one of the scenario for sling servlet in AEM.

  1. 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', "

  2. 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.

vipin gupta
  • 1
  • 1
  • 1
  • 2
    This is not really a question about AEM, rather a question about the difference between the default HTML
    submission and processing forms via AJAX. In that regard, there is a plethora of resources online.
    – Ahmed Musallam May 25 '18 at 16:47
  • There is no AEM involved here. Question is Form Submission Vs. Ajax. Please refer to this duplicate question: https://stackoverflow.com/questions/13293375/ajax-vs-form-submission – Saravana Prakash May 29 '18 at 01:48

0 Answers0