首页上一页 1 下一页尾页 3 条记录 1/1页
jsp项目开发案例全程实录第五章
发表在JavaWeb图书答疑
2016-03-29
是否精华
是
否
版块置顶:
是
否
编程后的全部信息
我也看出来可能是List那里出了问题
怎么检查com.wy.action.DepartmentAction.java这个类中,第32行调用的HQL,返回的List是否有值?
我qq是3188372195,真的搞不懂这个怎么回事
不过department_query有问题,mamger,cj,insertjob,employee的query也有类似的问题。
32行代码是这样的
List list = objectDao.getObjectList("from DepartmentForm order by id desc");
type Exception report
message An exception occurred processing JSP page /department_query.jsp at line 29
description The server encountered an internal error that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: An exception occurred processing JSP page /department_query.jsp at line 29
26: list=(List)request.getAttribute("list");
27: int pagesize=15; //指定每页显示的记录数
28:
29: list=pagination.getInitPage(list,Page,pagesize); //初始化分页信息
30: }else{
31: Page=pagination.getPage(str);
32: list=pagination.getAppointPage(Page); //获取指定页的数据
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:568)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:470)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1063)
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:386)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:229)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
root cause
java.lang.NullPointerException
com.wy.tool.MyPagination.getInitPage(MyPagination.java:16)
org.apache.jsp.department_005fquery_jsp._jspService(department_005fquery_jsp.java:129)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1063)
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:386)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:229)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.30 logs.
我也看出来可能是List那里出了问题
怎么检查com.wy.action.DepartmentAction.java这个类中,第32行调用的HQL,返回的List是否有值?
我qq是3188372195,真的搞不懂这个怎么回事
不过department_query有问题,mamger,cj,insertjob,employee的query也有类似的问题。
32行代码是这样的
List list = objectDao.getObjectList("from DepartmentForm order by id desc");
type Exception report
message An exception occurred processing JSP page /department_query.jsp at line 29
description The server encountered an internal error that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: An exception occurred processing JSP page /department_query.jsp at line 29
26: list=(List)request.getAttribute("list");
27: int pagesize=15; //指定每页显示的记录数
28:
29: list=pagination.getInitPage(list,Page,pagesize); //初始化分页信息
30: }else{
31: Page=pagination.getPage(str);
32: list=pagination.getAppointPage(Page); //获取指定页的数据
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:568)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:470)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1063)
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:386)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:229)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
root cause
java.lang.NullPointerException
com.wy.tool.MyPagination.getInitPage(MyPagination.java:16)
org.apache.jsp.department_005fquery_jsp._jspService(department_005fquery_jsp.java:129)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1063)
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:386)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:229)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.30 logs.