@RestController is a convenience annotation that does nothing more than adds the @Controller and @ResponseBody annotations in single statement. A key difference between a traditional MVC @Controller and the RESTful web service @RestController is the way that the HTTP response body is created. Rather than relying on a view technology to perform server-side rendering of the data to HTML, rest controller simply populates and returns the domain object itself. The object data is be written directly to the HTTP response as JSON or XML and parsed by client to further process it either for modifying the existing view or for any other purpose.

Using @Controller in spring mvc application

C#
@Controller
@RequestMapping("employees")
public class EmployeeController 
{
  @RequestMapping(value = "/{name}", method = RequestMethod.GET)
  public Employee getEmployeeByName(@PathVariable String name, Model model) {
 
    //pull data and set in model
 
    return employeeTemplate;
  }
}

Using @Controller with @ResponseBody in spring

C#
@Controller
@ResponseBody
@RequestMapping("employees")
public class EmployeeController 
{
  @RequestMapping(value = "/{name}", method = RequestMethod.GET, produces = "application/json")
  public Employee getEmployeeByName(@PathVariable String name) {
 
    //pull date
 
    return employee;
  }
}

Using @RestController in spring
 

C#
@RestController
@RequestMapping("employees")
public class EmployeeController 
{
  @RequestMapping(value = "/{name}", method = RequestMethod.GET, produces = "application/json")
  public Employee getEmployeeByName(@PathVariable String name) {
 
    //pull date
 
    return employee;
  }
}