Created
July 20, 2015 13:22
-
-
Save openbooks/847178d010cd1b296b75 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Controller | |
public class UserListController { | |
@Autowired | |
private UserService userService; | |
// URL「/user」, HTTPメソッドGETとマッピング | |
@RequestMapping(value = "/user", method = RequestMethod.GET) | |
public String showAllPerson( | |
@RequestParam("userId") int userId, Model model) { | |
User user = userService.fingbyId(userId); | |
// Viewに渡すオブジェクトを設定 | |
model.addAttribute("user", user); | |
// View名をreturn | |
return "user/detail"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment