500状态代码前几天运行了项目的前几页,但未找到js文件错误406
另一方面,发生500状态代码空指针异常的服务器遇到意外情况,无法完成对请求的处理。 通常,如果服务器端源代码发生错误,就会出现此问题。 除了空指针,敲击代码时遇到的错误最多的是500个
二.原因代码如下。
@ request mapping (/demand project type ) ) publicstringdemandprojecttype ) integerprohecttypeid,httpsession,modelm (//SSSS //在前端获取的参数system.out.println (prohecttypeid : ) prohecttypeid ); //此参数system.out.println (需求项目名称: )需求项目名称); 调用service方法以获取数据库listdemanddemands=demandservice.demand project type (prohecttypeid,demandProjectName ); //Moder设置返回的集合m.addattribute(demands )、demands )。 //页面返回'需求故障'; 由于session的参数值为空(null ),因此错误500表示空指针异常
2 .如何解决代码:
按需项目名称!=null (调用//service方法以获取数据库listdemanddemands=demandservice.demand project type (prohecttypeid,demandProjectName ) //Moder设置返回的集合m.addattribute(demands )、demands )。 //页面返回'需求故障'; } else {需求项目名称=' '; listdemanddemands=demandservice.demand project type (prohecttypeid,demandProjectName; m.addattribute('demands ',demands ); 返回'需求半小时'; }可以在后台写判断,为空时重置值
div class=' la yui-BTN-container ' %-- buttontype=' submit ' class=' la yui-BTN '查询项目/button-- % input type=' Hutton ' id=' context path ' input type=' button ' class=' la yui-BTN ' id=' with export '