问一下各位大佬,这个86行的空指针异常是怎么出现的?这个页面跳转语句怎么会出现空?以及怎么改

https://img4.mukewang.com/5cac195a0001fa1c08560597.jpg

String phonename = request.getParameter("phonename");
                String version = request.getParameter("version");
                String price = request.getParameter("price");
                String begin ;
                String end ;
                
                //第一次传值时为空串
                if(phonename==null){  
                    phonename = "";
                }
                if(version==null){      
                    version = "";
                }
                /*if(price==null){
                    price = "全部时间";
                }
                if("全部时间".equals(price)){
                    begin = "0";
                    end = "0";
                }else{
                    begin = request.getParameter("begin");
                    end = request.getParameter("end");
                }*/
                
                /*int begin2 = Integer.parseInt(begin);
                int end2 = Integer.parseInt(end);*/
                
                
                
                PhoneService phoneService = new PhoneServiceImpl();
                //List<Phone> list = phoneService.getPhoneList(phonename,version,begin2,end2);
                List<Phone> phonelist = phoneService.getPhoneList(phonename,version);
                
                
//                String begin3 = begin2+"";
//                String end3 = end2+"";
            
                
                request.setAttribute("phoneList", phonelist);
                request.setAttribute("phoneName", phonename);
                request.setAttribute("version", version);
                //request.setAttribute("begin", begin3);
                //request.setAttribute("end", end3);
                //request.setAttribute("price", price);
    此行为86行    request.getRequestDispatcher("phoneinfo_query.jsp").forward(request, response);


慕盖茨2165817
浏览 918回答 3
3回答

慕设计2395807

MJTUDGDHDZVDKADFBEUWTOQTWRUJOJGWYAWSOMOEOXAWEGJGIQTWENXHRTJKAKMCSIIRYIOKHUTDSPEAWSPFUPFPVRIYHPMPFOEZGJMBLBKTCSWLORUDNJMAWFNJNCGJZPYUQGPLBKZVEBEEGKZDFPFOEALAKTXGQSORNCZVSUDGWFOEJMORNXTWQTPTCLBQTWZOYGGDSAWYBLTDGFOXHJMIFBXHOEAXZCGWFBRKHJSBXOKAWSMIDTWMISUQTFNCSOENQGDFCEIXAPSIQTWTJSHFOQIDSBJYHKMCSPFTDZIETDMWEODGGOYOSBWZHENWGBRBWYDSOLFVXNQSBEUDZTDFIWOKNDMPQMILHYOKHXAPZOXHJFISGVPKNXUENDZHKOKMWLAEBEADXUJMIRUXGWEBBXUENEHXNQNPKGCFHKZPSRBQTVYTCRBERYOXODUKGQSGVKIXTEADTUUCRULBXZJZUXUCGPLUXTWZZIWSVYPXAXNNQMWFUXMCSVCLUDGJSOYSCZVDOXNVSOYOETCSVMIZIRHDFUSURGPZVYADTWSOYOQTCGPLHJTJSIEUTCRBKNCSVEHWMHLHKLBEUWSVXHCMHKAXGIEHEAXSISHJVRHSHQRAJGIWFNQAQDZPSBJFNDGIYNKNWOETPMOEHDGCNCYVKNQZIYVUJSBENKIISBJZVFBXIRAQNRAWMQKNXAJFBUUKUVIFPLONXZZMZJKXRDTWVPUTTZGPYZCLPVISYOUXUXZDGJMGJZBQJPPTWGRAALZLAELOYENXAPGMJDYXJRMTXTCMVFIFUKNDMOXVKTKNJLYURUXGISURTRYILNQGWFPYXACFIEHKNQMWZIFIYAQFPFSCYGWMVRNXGMJMUXTWZUQM

緦唸

代码不完整,没法准确定位问题。按你所说的问题,86行出现空指针。可能是 request.getRequestDispatcher("phoneinfo_query.jsp").forward(request, response);"phoneinfo_query.jsp" 这个参数路径写错导致的。重点是根据底下的root cause 报错显示,你这空指针也可能是web容器内此phoneinfo_query.jsp 页面上224行上出现了空指针,建议你可以去编译路径下的classpath下查看phoneinfo_query.jsp 224行代码
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java