jsp页面空指针异常
页面相关语句:<%ArrayListclist=(ArrayList)session.getAttribute("clist");inti=clist.size();Co...
页面相关语句:
<%ArrayList clist=(ArrayList)session.getAttribute("clist");
int i=clist.size();
ConsumerInfo ci=(ConsumerInfo)clist.get(i);
int cid=Integer.parseInt(ci.getCid())+1;%>
<input type="hidden" name="cid" value="<%=cid %>"/>
相同类型的jsp页面就能实现功能,为什么这个实现不了?
org.apache.jasper.JasperException: java.lang.NullPointerException
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:491)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root causejava.lang.NullPointerExceptionorg.apache.jsp.addconsumer_jsp._jspService(addconsumer_jsp.java:114)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717) 展开
<%ArrayList clist=(ArrayList)session.getAttribute("clist");
int i=clist.size();
ConsumerInfo ci=(ConsumerInfo)clist.get(i);
int cid=Integer.parseInt(ci.getCid())+1;%>
<input type="hidden" name="cid" value="<%=cid %>"/>
相同类型的jsp页面就能实现功能,为什么这个实现不了?
org.apache.jasper.JasperException: java.lang.NullPointerException
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:491)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
root causejava.lang.NullPointerExceptionorg.apache.jsp.addconsumer_jsp._jspService(addconsumer_jsp.java:114)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717) 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询