日期:2014-05-17 浏览次数:20764 次
<form name="pagination" action="PagInationServlet" method="post"> <input type="hidden" name="result1" value="${requestScope.result1}"> <input type="hidden" name="result2" value="${requestScope.result2}"> <input type="hidden" name="result3" value="${requestScope.result3}"> <select name="pageForm" onchange="choosePageIndex()"> <c:forEach items="${requestScope.listPage}" var="page"> <option value="${page }" >${page }</option> </c:forEach> </select> </form>
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String result1 = request.getParameter("result1"); String result2 = request.getParameter("result2"); String result3 = request.getParameter("result3"); lastZxBean lastZx = new lastZxBean(); String temp = request.getParameter("choosePageIndex"); Integer temp2 = Integer.valueOf(temp); int choosePageIndex = temp2.intValue(); List list = lastZx.query(choosePageIndex); request.setAttribute("objResult", list); request.setAttribute("result1", result1); request.setAttribute("result2", result2); request.setAttribute("result3", result3); request.getRequestDispatcher("jsps/list.jsp").forward(request, response); }
java.lang.NumberFormatException: null at java.lang.Integer.parseInt(Integer.java:415) at java.lang.Integer.valueOf(Integer.java:553) at com.xindun.controller.PagInationServlet.doGet(PagInationServlet.java:55) at com.xindun.controller.PagInationServlet.doPost(PagInationServlet.java:79)
String temp = request.getParameter("choosePageIndex"); Integer temp2 = Integer.valueOf(temp); int choosePageIndex = temp2.intValue();