title: Ajax call to a Struts action doesn't return a response
body: <p>I'm trying to call an action servlet createLabel.do but looks like the action class is not being evoked. I used firebug to debug and it looks like this url is called  but receiving is no response.<br>
  Here's the javascript function: </p>
  
  <pre><code>&lt;script  type="text/javascript" charset="utf-8"&gt;
      $(function() {
            $("#createLabel").click(function() {
              $.ajax( {
                type: "POST",      
                url: "/createLabel.do",
                dataType: "json",
                contentType: "application/json; charset=utf-8",
                data: { lab_no: $("#labNum").val(),accNum: $("#accNum").val(), label: $("#label").val() },
                success: function() {
                    alert("success");  
                }
              });
            });
      });
  
  &lt;/script&gt;
  </code></pre>
  
  <p>Here's my action class:</p>
  
  <pre><code>   public class CreateLabelAction extends Action{
  
  public ActionForward execute (ActionMapping mapping, HttpServletRequest request, HttpServletResponse response){
  
  
      String label = request.getParameter("label");
  
      String lab_no = request.getParameter("lab_no");
      String accNum = request.getParameter("accNum");
  
      response.setContentType("application/json");
      try {
          DB db = new DB(DB.DATA);
          Connection conn = db.GetConnection();
          String insertstmt = "update Info set label='"+label+"' where lab_no="+lab_no+" and accNum='"+accNum+"'";
          logger.info(insertstmt);
  
          PreparedStatement pstmt = conn.prepareStatement(insertstmt);
          pstmt.executeUpdate();
          pstmt.close();
          db.closeConn();
  
          logger.info("Label created successfully.");
  
  
      } catch (Exception e){
          logger.error("Error inserting label into Info" + e);
          request.setAttribute("error", "There was an error creating a label.");
  
      }
  
      logger.info("Label ="+label);
      label = StringEscapeUtils.escapeJavaScript(label);
              return mapping.findForward("complete");
  }
  
  }
  </code></pre>
  
  <p>Here's the configuration in struts-config.xml:</p>
  
  <pre><code> &lt;action input="/labDi.jsp" name="LabelForm" path="/createLabel" scope="request" type="all.pageUtil.CreateLabelAction"&gt;
          &lt;forward name="complete" path="/labDi.jsp" /&gt;
      &lt;/action&gt;
  </code></pre>
  
  <p>Can someone please tell me why the action class is not being evoked? Thanks in advance.</p>