About using aclManager.getAcls() return null?
Hi,All
my Hibernate class method:
public BookStore selBookStore (Integer bookStoreId) throws DataAccessException {
logger.info("selBookStore......");
BookStore bookStore= (BookStore)this.getHibernateTemplate().get(BookSto re.class, bookStoreId);
return bookStore;
}
and then Action class method:
public ModelAndView handleRequest(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
int bookStoreId = RequestUtils.getRequiredIntParameter(request, "bookStoreId");
BookStore bookStore = ibaoKaoDAO.selBookStore(new Integer(bookStoreId));
if(bookStoreId==null){
return null;
}
Map model = new HashMap();
try{
AclEntry[] acls = aclManager.getAcls(bookStore);
model.put("bookStore", bookStore);
model.put("acls", acls);
}
catch(Exception e){
System.out.println(e.toString());
}
return new ModelAndView("adminPermission", "model", model);
}
I am printing acls[0] ,acl[0] return is null and throw Exception is:java.lang.NullPointerException
why invoke aclManager.getAcls(bookStore) return null and i am sure that bookStore is not null?