title: Use a Servlet to handle AJAX requests?
body: <p>Basically a yes or no question but I am also looking for advice on best practices for implementation.</p>
  
  <p>Let me know when/if I start to go wrong.</p>
  
  <ul>
  <li>I have a specific Servlet (AjaxServlet?) that will handle all AJAX requests</li>
  <li>AjaxServlet maps to /ajax/* so all request URLs like /ajax/getDataFromServer will be handled by it</li>
  <li>My doGet overide function is a long if/elseif chain checking the request.getPathInfo() each time</li>
  <li>Each if block in doGet handles a specific url call (/ajax/getDataFromServer)</li>
  </ul>
  
  <p>I want to return JSON and so far I have been building these strings myself. Is there a lightweight JSON package I could use. I know I <em>could</em> for example extend ArrayList (ArrayListJson?) and add a toJson() method and then cast any ArrayList to ArrayListJson but I'm sure this has been done already.</p>