title: Jquery ajax call is not hitting servlet
body: <p>I am trying to make a simple ajax call.  No matter what I do, it always executes the error block.  I have a sysout in the doPost that is never hit.  Someone please tell me what I am doing wrong.  Here is my code.</p>
  
  <p>javascript----</p>
  
  <pre><code>$.ajax({
      url: "GetBulletAjax",
      dataType: 'json',
      success: function(data) {
          alert("success");
      },
       error: function(jqXHR, textStatus, errorThrown) {
          alert(jqXHR+" - "+textStatus+" - "+errorThrown);
      }       
  }); 
  </code></pre>
  
  <p>Java----</p>
  
  <pre><code>public class GetBulletAjax extends HttpServlet {
      private static final long serialVersionUID = 1L;
  
      public GetBulletAjax() {
          super();
      }
  
      protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
          doPost(request, response);
      }
  
      protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
          System.out.println("made it to servlet");
          PrintWriter out = response.getWriter(); 
          User user = (User) request.getSession().getAttribute("user");
          int userId = user.getId();
          List&lt;Bullet&gt; bullets;
  
          BulletDAO bulletdao = new BulletDAOImpl();
          try {
              bullets = bulletdao.findBulletsByUser(userId);
              Gson gson = new Gson();
              String json = gson.toJson(bullets);
              System.out.println(json);
              out.println(json);
              out.close();
  
          } catch (SQLException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }       
      }
  
  }
  </code></pre>
  
  <p>web.xml----</p>
  
  <pre><code>&lt;servlet&gt;
      &lt;servlet-name&gt;GetBulletAjax&lt;/servlet-name&gt;
      &lt;servlet-class&gt;bulletAjax.GetBulletAjax&lt;/servlet-class&gt;
    &lt;/servlet&gt;
    &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;GetBulletAjax&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/GetBulletAjax&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>