Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Creative commons Attribution-NonCommercial license. http://creativecommons.org/licenses/by-nc/2.5/au/deed.en_GB NO WARRANTY IS GIVEN OR IMPLIED, USE AT YOUR OWN RISK.
 
 package base.jee.servlet;
 
Display and allow updating all current system configuration settings.
public class GroupMembersServlet extends BaseServlet {
	private static final long serialVersionUID = 1L;
	public GroupMembersServlet(JeeBase jeethrows IOException {
		super(jee);
	}
	@SuppressWarnings("unchecked")
	public void doGet(String tokenUser uHttpServletRequest requestHttpServletResponse responsethrows ServletExceptionIOException {
		String error = null;
		UUID uuid = null;
		if(request.getParameter("uuid") != null) {
			try {
				uuid = UUID.fromString(request.getParameter("uuid"));
catch(Exception e) {
			}
		}
		Group group = .getAPI().getGroup(uuuid).get(0);
		if(request.getParameter("delete") != null && uuid != null) {
			if(request.getParameter("a") == null || !request.getParameter("a").equals(u.getFormAuthToken())) {
				throw new IllegalArgumentException("Invalid authentication token.");
			}
			//new UpsertGroup(ds, u, request.getParameter("name"), type).run();
			response.setHeader("Location".get("base.url""") + "/group.members?deleted=");
			response.setStatus(302);
			return;
		}
		List<Personpeople = .getAPI().getGroupMembers(uuuid);
		ST page = .getPage(u"group_members");
		page.add("group"group);
		page.add("people"people);
		page.add("error"error);
		page.add("breadcrumbs"new Breadcrumb("People""/people"));
		page.add("breadcrumbs"new Breadcrumb("Groups""/groups"));
		page.add("breadcrumbs"new Breadcrumb(group.getName() + " Members"null));
		page.add("auth"u.getFormAuthToken());
		response.getWriter().write(page.render());
	}
New to GrepCode? Check out our FAQ X