If you use Spring MVC, you can use the @RequestBody annotation for a method parameter that is of type String. For instance.
@RequestMapping(value = "/something", method = RequestMethod.POST)
public void doSomething(@RequestBody String requestBodyString) {
}
source
share