日期:2014-05-19 浏览次数:20735 次
public String getPassword(String userId)throws NoSuchUserException{ UserInfo user = userDao.queryUserById(userId); If(user == null){ Logger.info(“找不到该用户信息,userId=”+userId); throw new NoSuchUserException(“找不到该用户信息,userId=”+userId); } else{ return user.getPassword(); } } public void sendUserPassword(String userId)throws Exception { UserInfo user = null; try{ user = getPassword(userId); //…….. sendMail(); // }catch(NoSuchUserException ex)( logger.error(“找不到该用户信息:”+userId+ex); throw new Exception(ex); } }