1 package org.cacert.gigi.pages.main;
3 import java.io.IOException;
4 import java.io.PrintWriter;
5 import java.util.HashMap;
7 import javax.servlet.http.HttpServletRequest;
8 import javax.servlet.http.HttpServletResponse;
9 import javax.servlet.http.HttpSession;
11 import org.cacert.gigi.pages.Page;
13 public class RegisterPage extends Page {
15 private static final String SIGNUP_PROCESS = "signupProcess";
16 public static final String PATH = "/register";
18 public RegisterPage() {
23 public void doGet(HttpServletRequest req, HttpServletResponse resp)
25 PrintWriter out = resp.getWriter();
26 getDefaultTemplate().output(out, getLanguage(req),
27 new HashMap<String, Object>());
28 Signup s = getForm(req);
29 s.writeForm(out, getLanguage(req));
31 public Signup getForm(HttpServletRequest req) {
32 HttpSession hs = req.getSession();
33 Signup s = (Signup) hs.getAttribute(SIGNUP_PROCESS);
36 hs.setAttribute(SIGNUP_PROCESS, s);
42 public void doPost(HttpServletRequest req, HttpServletResponse resp)
44 Signup s = getForm(req);
45 if (s.submit(resp.getWriter(), req)) {
46 HttpSession hs = req.getSession();
47 hs.setAttribute(SIGNUP_PROCESS, null);
52 "Your information has been submitted"
53 + " into our system. You will now be sent an email with a web link,"
54 + " you need to open that link in your web browser within 24 hours"
55 + " or your information will be removed from our system!"));
59 super.doPost(req, resp);
62 public boolean needsLogin() {