title: unable to return the string from spring controller and show on the webpage
body: <p>I am using springmvc and angularjs to read the data and show on the webpage.
  For reading the data from URL i have used JSoup API.  </p>
  
  <p>Facing errors while dispalying the content read from the URL back to the webpage.Any suggestions would be helpful.</p>
  
  <p>code:</p>
  
  <p>html:</p>
  
  <pre><code>&lt;div ng-controller="readContentController"&gt;
                                  &lt;div&gt;
                                      {{content}}
                                  &lt;/div&gt;
                              &lt;/div&gt;
  </code></pre>
  
  <p>js code:</p>
  
  <pre><code>//controller
  
  myApp.controller('readContentController', function ($rootScope, $scope, $sce, ReportService, $window) {
      $scope.content = {};
      MyService.getDataFromURL().then(
          function (response) {
              console.log("response :" + response);
              $scope.content = response;
               },
          function (errResponse) {
             $rootScope.showError("error :" + errResponse);
          });
  });
  //service call
  myServiceFactory.getDataFromURL = function(){
          var deferred = $q.defer();
  
          $http.get('/getHTMLDataFromURL')
              .then(
                  function (response) {
                      deferred.resolve(response.data);
                  },
                  function(errResponse){
                      console.error('Error while fetching data' + errResponse);
                      deferred.reject(errResponse);
                  }
              );
          return deferred.promise;
      }
  </code></pre>
  
  <p>spring controller:</p>
  
  <pre><code>@RequestMapping(value = "/getHTMLDataFromURL", method = RequestMethod.GET)
      public
      @ResponseBody String getHtmlStrigContent() throws Exception {
          Document doc = Jsoup.connect("https://xyz.abc.com/myFile.pdf").get();
          String htmlString = doc.toString();
          System.out.println("asD" + htmlString);
          return htmlString;
  }
  </code></pre>
  
  <p>Error message:</p>
  
  <pre><code>SyntaxError: Unexpected token &lt; in JSON at position 0
      at JSON.parse (&lt;anonymous&gt;)
      at Ec (angular.min.js:16)
      at ic (angular.min.js:93)
      at angular.min.js:93
      at q (angular.min.js:7)
      at od (angular.min.js:93)
      at f (angular.min.js:95)
      at angular.min.js:132
      at m.$eval (angular.min.js:146)
      at m.$digest (angular.min.js:143)
  (anonymous) @ angular.min.js:119
  myService.js:158 Error while fetching dataSyntaxError: Unexpected token &lt; in JSON at position 0
  </code></pre>
  
  <p>I trying to read the content from another webpage and display in our application webpage.</p>