tomcat问题 麻烦高手解决下 不胜感激
40: List<Category> categories = CategoryService.getInstance().getCategories(); 空指针异常; 先判断一下试试; List<Category> categories =new ArrayList(); if(CategoryService.getInstance()!=null&&CategoryService.getInstance().getCategories()!=null){ categories = CategoryService.getInstance().getCategories(); }
你的CategoryService.getInstance().getCategories(); 返回的List是一个Null仔细看看你的方法返回有没有东西,DEBUG一下
空指针异常CategoryService.getInstance().getCategories();没有值
很明显categories 为null在你的程序中首先做一些安全性的机制,看看categories 是否为null,如果为null的话就不要再继续执行,或者进行其他的处理