package com.mstf.action; import java.io.IOException; import java.util.List; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.mstf.bean.Info; import com.mstf.bean.Page; import com.mstf.service.InfoService; import com.mstf.service.impl.InfoServiceImpl; import com.mstf.tx.PageConfig; public class InfoAction extends HttpServlet { private InfoService infoService = new InfoServiceImpl(); public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doPost(request, response) ; } public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String action = request.getParameter("action") ; if("all".equals(action)) { String name = request.getParameter("name") ; int currentPage = 1 ; String paramPage = request.getParameter("currentPage") ; currentPage = paramPage== null ? 1:Integer.parseInt(paramPage) ; // // List<Info> infoList = infoService.getAll(name,currentPage); // // // 计算总页数 // int rowCount = infoService.getRowCount(name); // //// int pageCount = rowCount%PageConfig.PAGESIZE ==0 ? rowCount/PageConfig.PAGESIZE :rowCount/PageConfig.PAGESIZE+1 ; // // int pageCount = (rowCount +PageConfig.PAGESIZE -1)/PageConfig.PAGESIZE ; // // request.setAttribute("name", name) ; // request.setAttribute("infoList", infoList) ; // request.setAttribute("currentPage", currentPage) ; // request.setAttribute("pageCount", pageCount) ; Page page = infoService.getPage(name,currentPage); request.setAttribute("name", name) ; request.setAttribute("page", page) ; request.getRequestDispatcher("/show.jsp").forward(request, response); } } }

xiongwei11231 LV9
2024年1月15日
321170193 LV6
2023年11月12日
另类清晨 LV8
2023年9月19日
2017143155 LV12
2023年7月19日
include LV8
2022年12月31日
gshnbb LV9
2022年12月11日
不正经的90后程序猿 LV1
2022年12月10日
qiuqiuqiu111 LV4
2022年12月5日
13112360 LV2
2022年9月27日
hunterwang LV4
2022年8月26日

renjunyou LV10
6月2日
13188140406
3月12日
暂无贡献等级
微信网友_7311533327257600
2024年12月25日
暂无贡献等级
571818771 LV3
2024年12月16日
wzd031105 LV2
2024年12月6日
Yuehao
2024年6月26日
暂无贡献等级
ma406805131 LV19
2024年6月18日
2640660246
2024年5月10日
暂无贡献等级
pangzhihui LV14
2024年4月15日
惺惺惜惺惺嘻嘻嘻
2024年3月29日
暂无贡献等级