if(friend==null)
msg = getMessage(request,null,"error.user_not_found", new Integer(friendId));
else if(friendId == loginUser.getId())
msg = getMessage(request,null,"error.cannot_add_myself");
else{
FriendBean fb = new FriendBean();
fb.setAddTime(new Date());
fb.setFriend(friend);
fb.setOwner(loginUser.getId());
fb.setType(FriendBean.TYPE_GENERAL);
fb.setRole(FriendBean.ROLE_GENERAL);
UserDAO.addFriend(fb);
msg = getMessage(request,null,"error.friend_added", new Integer(friendId));
}
}
else