if(session.getAttribute("manager")==null) {} else {String manager2=session.getAttribute("manager").toString(); //这才能取,要不为空就会出错}