title: Get response text from a JSONP request in Ext / Java Application
body: <p>I am trying to connect a Java REST service to a ExtJs JSONP request but even though the java method executes I haven't been able to get a response test. This is what I am trying:</p>
  
  <p>Java Code:</p>
  
  <pre><code>@Path("/hello")
  public class Hello {
  
        @GET
        @Produces("text/javascript") // have also tried application/json
        public String sayJsonHello(@QueryParam("_dc") String dcIdentifier, @QueryParam("callback") String callback) {
            System.out.println(callback);
            callback += "({\"success\":true, \"msj\":" + "\"" + "Exitoooo!" + "\" });";
            System.out.println(callback);
          return callback;
        }
  
  }
  </code></pre>
  
  <p>ExtJs code: </p>
  
  <pre><code>    Ext.data.JsonP.request({
          url: "http://10.1.50.66:7001/Simulador/webresources/hello",
          params: {
          },
          callback: function (response) {
              console.log(response); //true
              console.log(response.result); //undefined
              console.log(response.responseText); //undefined
              console.log(response.success); // undefined
              if (response.success === true) {
                  Ext.Msg.alert('Link Shortened', response.msj, Ext.emptyFn);
              } else { // entering here :( why ?
                  Ext.Msg.alert('Error', response.msj, Ext.emptyFn);
              }
          }
      });
  </code></pre>
  
  <p>response is printting true, everything else undefined :( </p>
  
  <p>callback looks like this <code>Ext.data.JsonP.callback1({"success":true, "msj":"exito"})</code></p>
  
  <p>Any ideas what could be wrong?</p>