]> WPIA git - gigi.git/blobdiff - src/org/cacert/gigi/Gigi.java
Fixed missing enter
[gigi.git] / src / org / cacert / gigi / Gigi.java
index 8cc076e19e6a3839b7e409fb44d69d1033ef4b80..540433580e9c11a6a27b6c7a3f68cc9ac7c0a7dc 100644 (file)
@@ -23,6 +23,7 @@ import org.cacert.gigi.pages.Page;
 import org.cacert.gigi.pages.PolicyRedir;
 import org.cacert.gigi.pages.TestSecure;
 import org.cacert.gigi.pages.Verify;
+import org.cacert.gigi.pages.account.MailAdd;
 import org.cacert.gigi.pages.account.MailCertificates;
 import org.cacert.gigi.pages.account.MailOverview;
 import org.cacert.gigi.pages.account.MyDetails;
@@ -47,19 +48,20 @@ public class Gigi extends HttpServlet {
                pages.put("/", new MainPage("CACert - Home"));
                pages.put("/secure", new TestSecure());
                pages.put(Verify.PATH, new Verify());
-               pages.put(AssurePage.PATH, new AssurePage());
+               pages.put(AssurePage.PATH + "/*", new AssurePage());
                pages.put(MailCertificates.PATH, new MailCertificates());
                pages.put(MyDetails.PATH, new MyDetails());
                pages.put(RegisterPage.PATH, new RegisterPage());
                pages.put(PolicyRedir.PATH, new PolicyRedir());
                pages.put(MailOverview.DEFAULT_PATH, new MailOverview(
                                "My email addresses"));
+               pages.put(MailAdd.DEFAULT_PATH, new MailAdd("Add new email"));
                String templ = "";
                try (BufferedReader reader = new BufferedReader(new InputStreamReader(
                                new FileInputStream(new File("templates/base.html"))))) {
                        String tmp;
                        while ((tmp = reader.readLine()) != null) {
-                               templ += tmp;
+                               templ += tmp + "\n";
                        }
                        baseTemplate = templ.split("\\$content\\$");
                } catch (Exception e) {
@@ -113,7 +115,9 @@ public class Gigi extends HttpServlet {
 
        }
        private Page getPage(String pathInfo) {
-
+               if (pathInfo.endsWith("/") && !pathInfo.equals("/")) {
+                       pathInfo = pathInfo.substring(0, pathInfo.length() - 1);
+               }
                Page page = pages.get(pathInfo);
                if (page != null) {
                        return page;