aboutsummaryrefslogtreecommitdiff
path: root/src/java/com/juick/http/www/Main.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/com/juick/http/www/Main.java')
-rw-r--r--src/java/com/juick/http/www/Main.java21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/java/com/juick/http/www/Main.java b/src/java/com/juick/http/www/Main.java
index 4c6e310b..8b760e44 100644
--- a/src/java/com/juick/http/www/Main.java
+++ b/src/java/com/juick/http/www/Main.java
@@ -41,7 +41,8 @@ public class Main extends HttpServlet {
Connection sql;
Connection sqlSearch;
Stream xmpp;
- Blogs blogs = new Blogs();
+ Home home = new Home();
+ Discover discover = new Discover();
Login login = new Login();
Help help = new Help();
User pagesUser = new User();
@@ -111,14 +112,10 @@ public class Main extends HttpServlet {
if (uri.equals("/")) {
com.juick.User visitor = Utils.getVisitorUser(sql, request);
- if (request.getQueryString() == null) {
- if (visitor == null) {
- login.doGetLoginForm(sql, request, response);
- } else {
- blogs.doGet(sql, sqlSearch, request, response, visitor);
- }
+ if (visitor == null) {
+ login.doGetLoginForm(sql, request, response);
} else {
- blogs.doGet(sql, sqlSearch, request, response, visitor);
+ home.doGet(sql, sqlSearch, request, response, visitor);
}
} else if (uri.equals("/post")) {
com.juick.User visitor = Utils.getVisitorUser(sql, request);
@@ -147,12 +144,10 @@ public class Main extends HttpServlet {
help.doRedirectToHelpIndex(sql, request, response);
} else if (uri.startsWith("/help/")) {
help.doGetHelp(sql, request, response);
+ } else if (uri.equals("/discover")) {
+ discover.doGet(sql, sqlSearch, request, response);
} else if (uri.startsWith("/tag/")) {
- com.juick.User visitor = Utils.getVisitorUser(sql, request);
- blogs.doGet(sql, sqlSearch, request, response, visitor);
- } else if (uri.startsWith("/places/")) {
- com.juick.User visitor = Utils.getVisitorUser(sql, request);
- blogs.doGet(sql, sqlSearch, request, response, visitor);
+ discover.doGet(sql, sqlSearch, request, response);
} else if (uri.matches("^/\\d+$")) {
String strID = request.getRequestURI().substring(1);
int mid = 0;