aboutsummaryrefslogtreecommitdiff
path: root/src/java/com/juick/http/www/Main.java
diff options
context:
space:
mode:
authorGravatar Ugnich Anton2013-10-24 01:24:19 +0700
committerGravatar Ugnich Anton2013-10-24 01:24:19 +0700
commit19dbb5c44b3c32b894ed2c3c83d6c67aa69e7c17 (patch)
tree29bfc3ebc1f5d098143355eb2a17aff560378165 /src/java/com/juick/http/www/Main.java
parent1ff9fecd9342970bdc4a835ee5a57a5f27cdd206 (diff)
Home + Discover
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;