-
//获取学生性别 int gender=Constant.DEFAULT_GENDER; String genderStr=request.getParameter("gender"); if(genderStr!=null&&!"".equals(genderStr.trim())){ gender=Integer.parseInt(genderStr); }查看全部
-
/** *默认每页显示多少条记录 */ public static final int DEFAULT_PAGE_SIZE=5; /** *默认显示第几页记录 */ public static final int DEFAULT_PAGE_NUM=1; /** *默认学生性别 */ public static final int DEFAULT_GENDER=0;查看全部
-
<c:forEach> <tr> <td><c:out value="${student.stuName}"></c:out></td> <td> <c:if test="${student.gender eq 1}">男</c:if> <c:if test="${student.gender eq 0}">女</c:if> </td> <td><c:out value="${student.age}"></c:out></td> <td><c:out value="${student.address}"></c:out></td> </tr> </c:forEach>查看全部
-
<!-- 后台返回结果为空 --> <c:if test="${fn:length(result.dataList) eq 0}"> <span>查询的结果不存在</span> </c:if> <!-- 后台结果不为空 --> <c:if test="${fn:length(result.dataList) gt 0}"> <span>查询的结果不存在</span> </c:if>查看全部
-
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>查看全部
-
<form action="<%=context%> /sublist/SublistServlet" id="stuForm">查看全部
-
<form action="<%=context%>" id="stuForm">查看全部
-
//获取请求上下文 <% String context=request.getContextPath(); %>查看全部
-
//返回结果到页面 request.setAttribute("result",result); request.getRequestDispatcher("sublistStudent.jsp").foreach(request,response);查看全部
-
//调用service获取查询结果 Pager<Student> result=studentService.findStudent(searchModel,pageNum,pageSize);查看全部
-
//组装查询条件 Student searchModel=new Student(); searchModel.setStuName(stuName); searchModel.setGender(gender);查看全部
-
//接收request里的参数 String stuName=request.getParameter("stuName");//学生姓名 String genderStr=request.getParameter("gender"); int gender=Integer.parseInt(genderStr);//获取学生性别 String pageNumStr=request.getParameter("pageNum"); int pageNum=Integer.parseInt(pageNumStr);//显示第几页数据 String pageSizeStr=request.getParameter("pageSize"); int pageSize=Integer.parseInt(pageSizeStr);//每页显示多少条纪录查看全部
-
public class SublistServlet extends HttpServlet{ private static final long serialVersionUID=-3658128508633145268L; private StudentService studentService=new SublistStudentServiceImpl(); }查看全部
-
public void doGet(HttpServletRequest request,HttpServletResponse response)throws ServletException,IOException{ doPost(request,response); } public void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException{ doGet(request,response); }查看全部
-
@Override public Pager<Student> findStudent(Student searchModel,int pageNum,int pageSize); return result;查看全部
举报
0/150
提交
取消