Spring / Spring MVC Interview questions
How do I return a string from the Spring MVC controller without a view?
Set the return type of the method as String and mark the method with @ResponseBody annotation.
@RequestMapping(value="/returnHelloWorld", method=GET) @ResponseBody public String returnHelloMethod() { return "Hello world!"; }
More Related questions...