예제 #1
0
 @RequestMapping(value = "")
 public ModelAndView index() {
   List<User> users = userService.getAllUsers();
   ModelAndView modelView = new ModelAndView("users/index");
   modelView.addObject("users", users);
   return modelView;
 }
예제 #2
0
 @RequestMapping(method = RequestMethod.GET, produces = "application/json")
 public @ResponseBody ResponseEntity index() {
   List<User> users = userService.getAllUsers();
   return new ResponseEntity<List<User>>(users, HttpStatus.OK);
 }