aboutsummaryrefslogtreecommitdiff
path: root/juick-www/src/main/java/com/juick/www/Main.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-12-16 15:41:14 +0300
committerGravatar Vitaly Takmazov2016-12-16 15:41:14 +0300
commit300a0439b2a6e26d9025247ef780c886616d4ae1 (patch)
treebcdb7613c2c5f37b870cbe18241894dba9428fae /juick-www/src/main/java/com/juick/www/Main.java
parent18a8595d2150edc92084c94b9dbb8f4309d3ed36 (diff)
CharEncoding.UTF_8
Diffstat (limited to 'juick-www/src/main/java/com/juick/www/Main.java')
-rw-r--r--juick-www/src/main/java/com/juick/www/Main.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/juick-www/src/main/java/com/juick/www/Main.java b/juick-www/src/main/java/com/juick/www/Main.java
index 27ecf3ec..077a3e32 100644
--- a/juick-www/src/main/java/com/juick/www/Main.java
+++ b/juick-www/src/main/java/com/juick/www/Main.java
@@ -22,6 +22,7 @@ import com.juick.server.UserQueries;
import com.mitchellbosecke.pebble.error.PebbleException;
import org.apache.commons.dbcp2.BasicDataSource;
import org.apache.commons.lang3.BooleanUtils;
+import org.apache.commons.lang3.CharEncoding;
import org.apache.commons.lang3.math.NumberUtils;
import org.springframework.jdbc.core.JdbcTemplate;
import rocks.xmpp.addr.Jid;
@@ -147,14 +148,14 @@ public class Main extends HttpServlet {
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
if (request.getCharacterEncoding() == null) {
- request.setCharacterEncoding("UTF-8");
+ request.setCharacterEncoding(CharEncoding.UTF_8);
}
String uri = request.getRequestURI();
if (uri.equals("/")) {
String tag = request.getParameter("tag");
if (tag != null) {
- Utils.sendPermanentRedirect(response, "/tag/" + URLEncoder.encode(tag, "UTF-8"));
+ Utils.sendPermanentRedirect(response, "/tag/" + URLEncoder.encode(tag, CharEncoding.UTF_8));
} else {
com.juick.User visitor = Utils.getVisitorUser(sql, request, response);
home.doGet(sql, sqlSearch, request, response, visitor);
@@ -323,7 +324,7 @@ public class Main extends HttpServlet {
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
if (request.getCharacterEncoding() == null) {
- request.setCharacterEncoding("UTF-8");
+ request.setCharacterEncoding(CharEncoding.UTF_8);
}
String uri = request.getRequestURI();