Created
December 12, 2012 14:37
-
-
Save krams915/4268228 to your computer and use it in GitHub Desktop.
Spring Thymeleaf UserController snippet
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 | |
@RequestMapping("/users") | |
public class UserController { | |
@RequestMapping | |
public String getUsersPage(ModelMap model) { | |
Pageable pageRequest = new PageRequest(0, 10); | |
Page<User> users = repository.findAll(pageRequest); | |
model.addAttribute("users", UserMapper.map(users)); | |
model.addAttribute("commanduser", new UserDto()); | |
model.addAttribute("usertype", "new"); | |
return "users"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment