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 LV8
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日
Java开发工程师_初心 LV1
2022年12月10日
qiuqiuqiu111 LV4
2022年12月5日
13112360 LV2
2022年9月27日
hunterwang LV4
2022年8月26日
最近浏览更多
pangzhihui LV12
4月15日
惺惺惜惺惺嘻嘻嘻
3月29日
暂无贡献等级
sssz123
2月21日
暂无贡献等级
王冰冰0001
1月15日
暂无贡献等级
xiongwei11231 LV8
1月15日
2131234536546 LV7
1月4日
沈从文 LV2
2023年12月31日
微信网友_6802139027345408 LV2
2023年12月31日
qwerewqss
2023年12月30日
暂无贡献等级
hxy19991216 LV4
2023年12月29日