title: Return data to ajax from java Servlet method doGet
body: <p>I have my function ajax like this : </p>
  
  <pre><code>$.ajax({
          url: "associer_type_flux", // It's  my servlet
          dataType : "xml",
          type : "GET",
          data : { },
          success: function(response){
              alert("fine");
          },
          error:  function(data, status, er){
              alert(data+"_"+status+"_"+er);
          }
      });
  </code></pre>
  
  <p>And my method doGet in my servlet like this : </p>
  
  <pre><code>protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
      String forward = ""; 
      try {           
          String fluxXML = "";
          ServicesCodeTypeFluxGlobaux servicesCodeTypeFluxGlobaux = new ServicesCodeTypeFluxGlobauxImpl();
  
              fluxXML = "&lt;lescodetypeflux&gt;";
  
              fluxXML += "&lt;/lescodetypeflux&gt;";
              PrintWriter printWriter  = response.getWriter();
              printWriter.println(fluxXML);
  
          }
          forward = "/associerCode/accueil_association.jsp";
          getServletContext().getRequestDispatcher(forward).forward(request, response);           
      }
      catch (Exception e) {
          forward = "/erreur.jsp";
          request.setAttribute("msg", e.getMessage());
      }       
  }
  </code></pre>
  
  <p>So my problem is that, I cant get data in my jsp .. But i don't know how get this data or return this data from doGet method .. Now I have an alert Error ..</p>
  
  <p>Thx </p>