title: get value from servlet using ajax
body: <p>I want to fetch object from servlet.</p>
  
  <p>I try below code but I get "[object Object]" . I want "Description" value.</p>
  
  <p>I got out in browser when I run <a href="http://www.host.com/f/ServletToJSP1/" rel="nofollow">http://www.host.com/f/ServletToJSP1/</a>*</p>
  
  <p>o/p {"Description":"Nutanix provides disruptive datacenter infrastructure solutions that are hyper-efficient, massively scalable and elegantly simple."} </p>
  
  <p>in console log :Uncaught ReferenceError: google is not defined </p>
  
  <p>How can I do that ?</p>
  
  <pre><code>jsp code
                    $.ajax({
                          url : 'ServletToJSP1', 
                          type : 'GET',
                          dataType : 'json', 
                          success : function(response) {
                              //response = $.parseJSON(response);
                              alert(response);
                          },
                          error : function(error) {
                              //error handling....
                              alert(error);
                          }
                      });
  </code></pre>
  
  <p><strong>servlet code</strong></p>
  
  <pre><code>JSONObject objTw = new JSONObject();
        objTw.put("Description", "Nutanix provides disruptive datacenter infrastructure solutions that are hyper-efficient, massively scalable and elegantly simple.");
  PrintWriter out = response.getWriter();
  response.setContentType("application/json"); 
  response.setCharacterEncoding("utf-8"); 
    out.println(objTw);
  </code></pre>