2 Replies Latest reply on Mar 15, 2013 2:36 PM by Yogesh Upadhyay

    How to call a servlet from js?

    leon825 Level 1

      js:

      function(dialog) {

                  var url = '/bin/logServlet';

                  var result = CQ.HTTP.eval(url);

                                    if (result.isMember) {

                      alert("Log ok");

                  }

              }

       

       

      java path:

      webcontent/apps/my app name/src/core/src/main/java/my app name/clinic/servlet/logServlet.java

       

       

      @Property(name = "sling.servlet.paths", value = "/bin/logServlet")

       

       

      running time error:

      No resource found

      Cannot serve request to /bin/logServlet in /libs/sling/servlet/errorhandler/404.jsp