61626364656667686970
WebUtils.setSessionAttribute(request, SESSION_USER, user); return user; } } if (user == null) { user = new GuestUser(); WebUtils.setSessionAttribute(request, SESSION_USER, user); } return user; }
38394041424344
public void setDao(SecurityDAO dao) { this.dao = dao; } @Override public User getActiveUser() { return name.equals("guest") ? new GuestUser() : dao.findUser(name); }
42434445464748
@Override public User getActiveUser() { return name.equals("guest") ? new GuestUser() : dao.findUser(name); } @Override public User getActiveUser(HttpServletRequest request) { return name.equals("guest") ? new GuestUser() : dao.findUser(name); }
96979899100101102103104
} return user == null ? setAnonymousUser(request) : user; } private User setAnonymousUser(HttpServletRequest request) { User user = new GuestUser(); if (request != null) WebUtils.setSessionAttribute(request, SESSION_USER, user); return user; }