title: pass a variable from a servlet to ajax
body: <p>I develop a system of voting star base, when the user vote, I am sending an ajax request to my servlet that puts the database update</p>
  
  <p>here is my ajax code:</p>
  
  <pre><code> $.ajax({
              type:'GET',
              contentType: "charset=utf-8",
              url:''+encodeURI('/RecommandationDefault/rating?track='+surat+'&amp;recitateur='+recitateur+'&amp;vote='+voteVal),
              success:function(resp){
                  alert(response);
              }
  
  
          });
  </code></pre>
  
  <p>and here is the code of my servlet</p>
  
  <pre><code>@Override
      protected void doGet(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {
          response.setContentType("text/html;charset=UTF-8");
          PrintWriter out = response.getWriter();
          String n1=new String(request.getParameter("track").getBytes("ISO-8859-1"),"UTF-8");
          System.out.println("track"+n1);
                  String n2=request.getParameter("recitateur");
          String n3=request.getParameter("vote");
          try {
              DaoLastfm D = new DaoLastfm();
              D.insert_vote(n2, n1, n3);
              // processRequest(request, response);
          } catch (SQLException ex) {
              Logger.getLogger(rating.class.getName()).log(Level.SEVERE, null, ex);
          }
      }
  </code></pre>
  
  <p>the insertion works flawlessly,</p>
  
  <p>My concern is how after insertion into the database, the servlet forwards to my javascript content in a variable?</p>