title: How to return string as a response to http request
body: <p>In my Maven app I have mapped put http request onto this function(using spring framework), and I want to check something inside it and send response as text. Then I want to send that request from angularjs and store that response into some variable from angularjs controller. This is what I have tried.</p>
  
  <pre><code>@RequestMapping(path="/play", method={RequestMethod.POST}, produces = {MediaType.APPLICATION_JSON_UTF8_VALUE})
  public String someFunction(){
      //...
      return "some text";
      }
  
  $scope.getResponse = function(param1, param2...){
  
              $http.post("url..").then(
                      function(response){
                          $scope.response = response.data.response;
                          console.info('success');
                      },
                      function(response){
                          console.info('failure');
                      })
  
          }
  </code></pre>
  
  <p>Http is mapped correctly and works from browser, problem is how to store textual response into some angularjs variable from controller.</p>