您的位置:首页 > 编程语言 > Java开发

nested exception is java.lang.NullPointerException

2018-02-15 18:49 477 查看
可能的原因是没有添加 @Autowired 注解,加上即可。
public class PropertyController {
@Autowired
PropertyService propertyService;
@Autowired
CategoryService categoryService;
@RequestMapping("admin_property_list")
public String list(int cid ,Model model, Page page) {
Category c = categoryService.get(cid);
System.out.println(cid);
List<Property> cs = propertyService.list(cid);
PageHelper.offsetPage(page.getStart(),page.getCount());
int total = (int)new PageInfo<>(cs).getTotal();
page.setTotal(total);
page.setParam("&cid="+c.getId());
model.addAttribute("ps", cs);
model.addAttribute("cid", cid);
model.addAttribute("page", page);
return "admin/listProperty1";
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐