示例#1
0
 /*
  * 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();
 }
示例#2
0
  @RequestMapping(
      value = {"/", "/list"},
      method = RequestMethod.GET,
      headers = "Accept=application/json")
  public Employee listEmployees() {

    List<Employee> employees = service.findAllEmployees();
    return employees.get(0);
  }