Pages in a own package
authorJanis Streib <janis@dogcraft.de>
Fri, 20 Jun 2014 16:43:12 +0000 (18:43 +0200)
committerFelix Dörre <felix@dogcraft.de>
Sat, 21 Jun 2014 14:34:11 +0000 (16:34 +0200)
src/org/cacert/gigi/Gigi.java
src/org/cacert/gigi/pages/LoginPage.java [moved from src/org/cacert/gigi/LoginPage.java with 88% similarity]
src/org/cacert/gigi/pages/MainPage.java [moved from src/org/cacert/gigi/MainPage.java with 83% similarity]

index b4ebf8b..1b730f2 100644 (file)
@@ -10,6 +10,9 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
 
+import org.cacert.gigi.pages.LoginPage;
+import org.cacert.gigi.pages.MainPage;
+
 public class Gigi extends HttpServlet {
        private HashMap<String, Page> pages = new HashMap<String, Page>();
 
@@ -58,7 +61,6 @@ public class Gigi extends HttpServlet {
                        resp.sendRedirect("/login");
                        return;
                }
-               System.out.println(req.getPathInfo());
                if (pages.containsKey(req.getPathInfo())) {
                        Page p = pages.get(req.getPathInfo());
                        p.doGet(req, resp);
similarity index 88%
rename from src/org/cacert/gigi/LoginPage.java
rename to src/org/cacert/gigi/pages/LoginPage.java
index 419ebb4..68fcfd1 100644 (file)
@@ -1,10 +1,12 @@
-package org.cacert.gigi;
+package org.cacert.gigi.pages;
 
 import java.io.IOException;
 
 import javax.servlet.ServletRequest;
 import javax.servlet.ServletResponse;
 
+import org.cacert.gigi.Page;
+
 public class LoginPage extends Page {
        @Override
        public void doGet(ServletRequest req, ServletResponse resp)
similarity index 83%
rename from src/org/cacert/gigi/MainPage.java
rename to src/org/cacert/gigi/pages/MainPage.java
index 6d52e8b..44d4f46 100644 (file)
@@ -1,10 +1,12 @@
-package org.cacert.gigi;
+package org.cacert.gigi.pages;
 
 import java.io.IOException;
 
 import javax.servlet.ServletRequest;
 import javax.servlet.ServletResponse;
 
+import org.cacert.gigi.Page;
+
 public class MainPage extends Page {
        @Override
        public void doGet(ServletRequest req, ServletResponse resp)