I want to update file on server.User can enter data and send request to server to update file content.For non empty string following code works but when user enter empty string i get exception.
angularJS code
$http.put("app/rest/updateMsg",fileContent)
Spring controller code
@RequestMapping(value = "/updateMsg", method = RequestMethod.PUT)
public ResponseEntity<Boolean> updateMsg(@RequestBody String fileContent){
//update file code
}
I found workaround for this . I explicitly set filecontent to " " when it is empty("").
Any other solution for this ?