Can any one tell me how I can return string message from controller?
If i just return a string from a controller method then spring mvc treating it as a jsp view nam
Simplest solution:
Just add quotes, I really don't know why it's not auto-implemented by Spring boot when response type defined as application/json, but it works great.
@PostMapping("/create") public String foo() { String result = "something" return "\"" + result + "\""; }