XMLRepo repo = XMLRepo.instance(pageContext); User user = (User)session.getAttribute("user"); String pid = request.getParameter("oid"); if ((user != null) && (pid != null)) { Project project = (Project)repo.get(new Project(pid), false); if (project != null) { project.addMember(user); repo.save(project); out.print("success"); return; } } failed