title: Configuring a Java HTTP servlet in Netbeans 7.3
body: <p>I've recently upgraded to Netbeans 7.3, and I quite don't get much of its project configuration and interface. For example, once I used to see the source packages with java classes, now I'm not able to see them only in the File panel. I have a package called batchUtility containing an HTTP servlet called batchQueryServlet.</p>
  
  <p>I have to post a JSON to batchQueryServlet via the jQuery.ajax() function and I'm not able to map the servlet. </p>
  
  <p>Since Netbeans 7.3 doesn't ship a config file, I've created one by myself clicking on the web-inf folder>new>web.xml file and wrote as follows:</p>
  
  <pre><code>&lt;web-app xmlns="http://java.sun.com/xml/ns/javaee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
       version="3.0"&gt;
  &lt;welcome-file-list&gt;
      &lt;welcome-file&gt;index.html&lt;/welcome-file&gt;
      &lt;welcome-file&gt;index.htm&lt;/welcome-file&gt;
      &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
      &lt;welcome-file&gt;default.html&lt;/welcome-file&gt;
      &lt;welcome-file&gt;default.htm&lt;/welcome-file&gt;
      &lt;welcome-file&gt;default.jsp&lt;/welcome-file&gt;
    &lt;/welcome-file-list&gt;
    &lt;servlet&gt;
      &lt;servlet-name&gt;batchQueryServlet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;/batchUtility.batchQueryServlet&lt;/servlet-class&gt;
    &lt;/servlet&gt;
    &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;batchQueryServlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/batchQueryServlet&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>but still, when issuing the request, I get a 404 error:</p>
  
  <pre><code>  $.ajax({
                              url: "/batchQueryServlet",
                              contentType: 'application/json',
                              data: json,
                              Accept: "text/html",
                              success: function(data, textStatus, jqXHR) {
                                  alert(data);
                              },
                              type: "POST"
                          });
  </code></pre>
  
  <p>Now, I'm pretty sure it doesn't find the class because if I call the servlet name I get a classNotFound exception. How could I fix that? (A quick and dirty solution would be using a JSP but I'd rather not do it).</p>
  
  <p>PS: I use version 7.0.34 of Tomcat.</p>
  
  <p><strong>EDIT</strong> The problem was I should use a proper src/java path for storing my .java classes instead of a plain folder (this is the reason I couldn't see the packages). Now I've fixed it. Thanks anyway for your time!</p>