aboutsummaryrefslogtreecommitdiff
path: root/juick-www/src/main/java/com
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-09-21 21:55:49 +0300
committerGravatar Vitaly Takmazov2016-09-21 21:55:49 +0300
commit611cecae107980963979f71a756be3120000772a (patch)
treed276589efa974999afb53a7452c93ec77cf038c9 /juick-www/src/main/java/com
parentd9379351e992704c7b93ed0b74d2e1c60e166538 (diff)
yet another NumberUtils fix
Diffstat (limited to 'juick-www/src/main/java/com')
-rw-r--r--juick-www/src/main/java/com/juick/www/Home.java10
1 files changed, 2 insertions, 8 deletions
diff --git a/juick-www/src/main/java/com/juick/www/Home.java b/juick-www/src/main/java/com/juick/www/Home.java
index 462c47bb..d8688b68 100644
--- a/juick-www/src/main/java/com/juick/www/Home.java
+++ b/juick-www/src/main/java/com/juick/www/Home.java
@@ -20,6 +20,7 @@ package com.juick.www;
import com.juick.server.AdsQueries;
import com.juick.server.MessagesQueries;
import org.apache.commons.lang3.StringEscapeUtils;
+import org.apache.commons.lang3.math.NumberUtils;
import org.springframework.jdbc.core.JdbcTemplate;
import javax.servlet.ServletException;
@@ -37,14 +38,7 @@ import java.util.List;
public class Home {
protected void doGet(JdbcTemplate sql, JdbcTemplate sqlSearch, HttpServletRequest request, HttpServletResponse response, com.juick.User visitor) throws ServletException, IOException {
- int paramBefore = 0;
- String paramBeforeStr = request.getParameter("before");
- if (paramBeforeStr != null) {
- try {
- paramBefore = Integer.parseInt(paramBeforeStr);
- } catch (NumberFormatException e) {
- }
- }
+ int paramBefore = NumberUtils.toInt(request.getParameter("before"), 0);
String paramSearch = request.getParameter("search");
if (paramSearch != null && paramSearch.length() > 64) {