JSP制作的网页系统,在原有界面上打算新增几个项目
具体出错信息如图:图片说明](https://img-ask.csdn.net/upload/201605/16/1463381855_325956.png)
index_jsp.java中200行至249行内容
String message = (String)request.getAttribute("message");
if(message == null){
message = "";
}
if (!message.trim().equals("")){
out.println("");<br> out.println("alert('"+message+"');");<br> out.println("");
}
request.removeAttribute("message");
String username=(String)session.getAttribute("user"); String sf=(String)session.getAttribute("sf");
if(username==null){
response.sendRedirect(path+"index.jsp");
}
else{
out.write("\r\n");
out.write("<body>\r\n");
out.write("<div class=\"right_cont\">\r\n");
out.write("<div class=\"title_right\"><strong>生产订单管理</strong></div> \r\n");
out.write("<div style=\"width:100%;margin:auto;\">\r\n");
out.write("<form action=\"\" method=\"post\" name=\"form3\">\t\r\n");
out.write("<table class=\"table table-bordered table-striped table-hover\">\r\n");
out.write(" <tbody>\r\n");
out.write(" <tr align=\"center\">\r\n");
out.write(" <td nowrap=\"nowrap\"><strong>序号</strong></td>\r\n");
out.write(" <td nowrap=\"nowrap\"><strong>产品名称</strong></td> \r\n");
out.write(" <td nowrap=\"nowrap\"><strong>订单编号</strong></td> \r\n");
out.write(" <td nowrap=\"nowrap\"><strong>订单时间</strong></td> \r\n");
out.write(" <td nowrap=\"nowrap\"><strong>订单单位</strong></td> \r\n");
out.write(" <td nowrap=\"nowrap\"><strong>数量</strong></td> \r\n");
out.write(" <td nowrap=\"nowrap\"><strong>联系人</strong></td>\r\n");
out.write(" <td nowrap=\"nowrap\"><strong>联系电话</strong></td>\r\n");
out.write(" <td nowrap=\"nowrap\"><strong>备注信息</strong></td> \r\n");
out.write(" <td width=\"80\" nowrap=\"nowrap\"><strong>操作</strong></td>\r\n");
out.write(" </tr>\r\n");
cb.setEVERYPAGENUM(12);
int cou = cb.getMessageCount("select count(*) from dd ");//得到信息总数
String page1=request.getParameter("page");
if(page1==null){
page1="1";
}
session.setAttribute("busMessageCount", cou + "");
session.setAttribute("busPage", page1);
List pagelist1 = cb.getMessage(Integer.parseInt(page1),"select * from dd order by id desc",10);
session.setAttribute("qqq", pagelist1);
int pageCount = cb.getPageCount(); //得到页数
session.setAttribute("busPageCount", pageCount + "");
List pagelist3=(ArrayList)session.getAttribute("qqq");
if(!pagelist3.isEmpty()){
for(int i=0;i<pagelist3.size();i++){
List pagelist2 =(ArrayList)pagelist3.get(i);
清理下tomcat或项目里的work目录里的东西, 试试
空指针异常一般debug跟进去就很容易找出来,你这request.getAttribute("message"),确定放有这个key?
应该是你这个request.getAttritube("message")的问题,貌似你没有在request域内存这个属性,所以获取的时候才会出现空指针异常。不妨试一下咯!希望对你有用