/* * This method will list all existing employees. */ @RequestMapping("/hello") public List<Employee> hello( @RequestParam(value = "name", required = false, defaultValue = "World") String name, Model model) { model.addAttribute("name", name); return service.findAllEmployees(); }
@RequestMapping( value = {"/", "/list"}, method = RequestMethod.GET, headers = "Accept=application/json") public Employee listEmployees() { List<Employee> employees = service.findAllEmployees(); return employees.get(0); }