String extension = (String) groupForm.get("groupName"); String displayExtension = (String) groupForm.get("groupDisplayName"); if(isEmpty(displayExtension))displayExtension=extension;
	public ActionForward grouperExecute(ActionMapping mapping, ActionForm form,			HttpServletRequest request, HttpServletResponse response,			HttpSession session, GrouperSession grouperSession)			throws Exception {		DynaActionForm groupForm = (DynaActionForm) form;		boolean groupExists = false;		String curNode = (String)groupForm.get("groupId");		if (curNode == null || "".equals(curNode)) {			//Need to find the stem in which new group wuill be created						curNode = getBrowseNode(session);		} else {			groupExists = true;		}		if (curNode == null || "".equals(curNode)) {			String defaultStem = getDefaultRootStemName(session);			Stem root = StemFinder.findByName(grouperSession, defaultStem);			curNode = root.getUuid();		}		//TODO: should be checked by the API and exception thrown?		String groupName = (String) groupForm.get("groupName");		if (!groupExists && !groupName.matches("[^ \"<>\\*]+")) {			request.setAttribute("message", new Message(					"groups.message.error.invalid-char", true));			if (groupExists) {				return mapping.findForward(FORWARD_EditAgain);			} else {				return mapping.findForward(FORWARD_CreateAgain);			}		}		if ("".equals(groupForm.get("groupDisplayName")))			groupForm.set("groupDisplayName", groupName);		Group group = null;		String id = curNode;				//TODO: should be transactional - so add map or List of attributes		if (groupExists) {			group = GroupFinder.findByUuid(grouperSession, curNode);		} else {			Stem parent = StemFinder.findByUuid(grouperSession,					curNode);			String extension = (String) groupForm.get("groupName");			String displayExtension = (String) groupForm.get("groupDisplayName");			if(isEmpty(displayExtension))displayExtension=extension;			group = parent.addChildGroup(extension,displayExtension );			groupForm.set("groupId", group.getUuid());			String [] privileges = request.getParameterValues("privileges");			if(privileges!=null) {				Subject grouperAll = SubjectFinder.findById("GrouperAll");				for(int i=0;i<privileges.length;i++) {					group.grantPriv(grouperAll,Privilege.getInstance(privileges[i]));				}			}		}		//TODO: are both these necessary?		request.setAttribute("groupId", group.getUuid());		groupForm.set("groupId",group.getUuid());		String val  =(String) groupForm.get("groupDescription");		if("".equals(val)) val=null;		if(val!=null)group.setDescription(val);			request.setAttribute("message", new Message(				"groups.message.group-saved", (String) groupForm						.get("groupDisplayName")));				//TODO: more sophistication in determining where to go?		String submit = request.getParameter("submit.save");		if (submit != null) {			return mapping.findForward(FORWARD_GroupSummary);		}		session.setAttribute("findForNode", group.getUuid());		return mapping.findForward(FORWARD_FindMembers);	}