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;
 
public class SignupConfirmServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
	private JeeBase jee;
	public SignupConfirmServlet(JeeBase jeeString authSuccessUrlthrows IOException {
		this. = jee;
		this. = authSuccessUrl;
	}

	protected void doGet(HttpServletRequest requestHttpServletResponse responsethrows ServletExceptionIOException {
		response.setContentType("text/html; charset=UTF-8");
		response.setCharacterEncoding("UTF-8");
		try {
			String requestToken = request.getParameter("token");
			if(requestToken != null && requestToken.length() > 0) {
				List<StringQueryResultresults = .getAPI().signUpConfirmation(requestToken, BaseServlet.getIp(request));
				AuthorisationFilter.attachCookieToResponse(responseresults.get(0).getString());
				// Sign-up succeeded, go to the "authSuccessUrl" as the starting page.
				response.setHeader("Location".getSettings().get("base.url""") + );
				response.setStatus(302);
				return;
			}
			// SignUpConfirmationFailed
		}
		String ip = BaseServlet.getIp(request);
		ST page = .getPage(new User(.getAPI().getUnauthenticatedRolesCache(), ip), "signup_confirmation_fail");
		page.remove("shortcuts"); // Don't need shortcuts on this page
		page.add("ldap_enabled".getSettings().get("ldap.enabled""true").equalsIgnoreCase("true"));
		page.add("breadcrumbs"new Breadcrumb("Signup confirmation failed"null));
		if(request.getParameter("fail") != null) {
			page.add("error""error");
		}
		response.getWriter().write(page.render());
		return;
	}
	protected void doPost(HttpServletRequest requestHttpServletResponse responsethrows ServletExceptionIOException {
		doGet(requestresponse);
	}
New to GrepCode? Check out our FAQ X