首页>代码>年末最代码部分源码大出血分享-freemarker,bootstrap,springdata jpa分页代码>/page_demo/src/main/java/com/zuidaima/www/controller/UserController.java
package com.zuidaima.www.controller; import javax.servlet.http.HttpSession; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import com.zuidaima.www.module.User; import com.zuidaima.www.service.UserService; @Controller @RequestMapping({ "/user" }) public class UserController { @Autowired public UserService<User> userService; @RequestMapping(value = "", method = RequestMethod.GET) public String user(ModelMap model, @RequestParam(value = "p", required = false, defaultValue = "1" + "") int p, HttpSession session) { Page<User> page = userService.findAll(p, 20); model.put("page", page); return "user/index"; } }
最近下载更多
2235140624 LV17
2021年8月18日
鸦葱 LV4
2021年6月2日
人间蒸发 LV23
2020年2月10日
lege321 LV4
2019年12月9日
ma修123456 LV7
2019年4月24日
lin6234 LV4
2018年6月19日
woshimyc LV3
2018年6月14日
杰胜天下 LV8
2018年5月15日
javelinbook LV2
2018年1月12日
sangbu LV4
2017年12月21日
最近浏览更多
killler
3月1日
暂无贡献等级
小芳同学 LV1
2023年12月7日
瑬瑬瑬瑬瑬
2022年11月26日
暂无贡献等级
qq1654486219 LV6
2022年10月26日
Hsy605 LV9
2022年6月20日
fengshengtian LV8
2022年2月25日
wszzynbzdm LV7
2022年1月10日
北巷枫 LV9
2021年12月14日
fantesy LV17
2021年11月25日
nihaomasb LV7
2021年9月4日