From 42718787291bed507caf4f7ae13f6c41f9b8d7ff Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 23 Nov 2016 12:08:45 +0300 Subject: using HttpServletResponse status codes --- juick-rss/src/main/java/com/juick/rss/Main.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'juick-rss') diff --git a/juick-rss/src/main/java/com/juick/rss/Main.java b/juick-rss/src/main/java/com/juick/rss/Main.java index 029057e3..04d87729 100644 --- a/juick-rss/src/main/java/com/juick/rss/Main.java +++ b/juick-rss/src/main/java/com/juick/rss/Main.java @@ -77,14 +77,14 @@ public class Main extends HttpServlet { List msgs = MessagesQueries.getMessages(sql, mids); responseMessages(response, 0, null, msgs); } else { - response.sendError(404); + response.sendError(HttpServletResponse.SC_NOT_FOUND); } } else if (uri.equals("/comments")) { int hours = NumberUtils.toInt(request.getParameter("hours"), 0); if (hours > 0 && hours < 13) { responseReplies(response, hours); } else { - response.sendError(404); + response.sendError(HttpServletResponse.SC_NOT_FOUND); } } else if (uri.matches("^/[a-zA-Z0-9\\-]{2,16}/blog$")) { String uname = uri.substring(1, uri.length() - 5); @@ -95,13 +95,13 @@ public class Main extends HttpServlet { List msgs = MessagesQueries.getMessages(sql, mids); responseMessages(response, uid, uname, msgs); } else { - response.sendError(404); + response.sendError(HttpServletResponse.SC_NOT_FOUND); } } else { - response.sendError(404); + response.sendError(HttpServletResponse.SC_NOT_FOUND); } } else { - response.sendError(404); + response.sendError(HttpServletResponse.SC_NOT_FOUND); } } -- cgit v1.2.3