Can i be provided with an example of a scenario whereby i have a Servet as such :
@WebServlet(name = "testservlet", urlPatterns = {"/testservlet"})
public class testservlet extends HttpServlet {    
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
          Data d = new Data();  
          ArrayList infos = d.getData(String ID);  
        }
How can i pass the value for getData method in javascript using ajax and receive the reply by sending back the infos object ? I will appreciate an example in javascript. This should be triggered by an on button click. Please your reply should be like a tutorial
 
    