From bdbf65e0a50758bfcc88e1cc9c501eeed4e7e45d Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 12 Jul 2016 17:39:33 +0300 Subject: jackson-databind WIP --- juick-www/src/main/java/com/juick/www/Discover.java | 10 +++++----- juick-www/src/main/java/com/juick/www/NewMessage.java | 4 +++- .../src/main/java/com/juick/www/PageTemplates.java | 4 ++-- juick-www/src/main/java/com/juick/www/User.java | 19 +++++++++++-------- 4 files changed, 21 insertions(+), 16 deletions(-) (limited to 'juick-www/src/main') diff --git a/juick-www/src/main/java/com/juick/www/Discover.java b/juick-www/src/main/java/com/juick/www/Discover.java index 240d0fdd..e94d6e99 100644 --- a/juick-www/src/main/java/com/juick/www/Discover.java +++ b/juick-www/src/main/java/com/juick/www/Discover.java @@ -47,14 +47,14 @@ public class Discover { return; } else if (paramTag.SynonymID > 0 && paramTag.TID != paramTag.SynonymID) { com.juick.Tag synTag = TagQueries.getTag(sql, paramTag.SynonymID); - String url = "/tag/" + URLEncoder.encode(synTag.Name, "UTF-8"); + String url = "/tag/" + URLEncoder.encode(synTag.getName(), "UTF-8"); if (request.getQueryString() != null) { url += "?" + request.getQueryString(); } Utils.sendPermanentRedirect(response, url); return; - } else if (!paramTag.Name.equals(paramTagStr)) { - String url = "/tag/" + URLEncoder.encode(paramTag.Name, "UTF-8"); + } else if (!paramTag.getName().equals(paramTagStr)) { + String url = "/tag/" + URLEncoder.encode(paramTag.getName(), "UTF-8"); if (request.getQueryString() != null) { url += "?" + request.getQueryString(); } @@ -73,7 +73,7 @@ public class Discover { int visitor_uid = visitor.getUID(); - String title = "*" + Utils.encodeHTML(paramTag.Name); + String title = "*" + Utils.encodeHTML(paramTag.getName()); List mids = MessagesQueries.getTag(sql, paramTag.TID, visitor_uid, paramBefore, (visitor_uid == 0) ? 40 : 20); response.setContentType("text/html; charset=UTF-8"); @@ -104,7 +104,7 @@ public class Discover { } if (mids.size() >= 20) { - String nextpage = "/tag/" + URLEncoder.encode(paramTag.Name, "UTF-8") + "?before=" + mids.get(mids.size() - 1); + String nextpage = "/tag/" + URLEncoder.encode(paramTag.getName(), "UTF-8") + "?before=" + mids.get(mids.size() - 1); out.println("

Читать дальше →

"); } diff --git a/juick-www/src/main/java/com/juick/www/NewMessage.java b/juick-www/src/main/java/com/juick/www/NewMessage.java index 397badbb..bb169b60 100644 --- a/juick-www/src/main/java/com/juick/www/NewMessage.java +++ b/juick-www/src/main/java/com/juick/www/NewMessage.java @@ -113,7 +113,9 @@ public class NewMessage { } String taglink = ""; try { - taglink = "" + Utils.encodeHTML(tags.get(i).Name) + ""; + taglink = "" + Utils.encodeHTML(tags.get(i).getName()) + ""; } catch (UnsupportedEncodingException e) { } int usagecnt = tags.get(i).UsageCnt; diff --git a/juick-www/src/main/java/com/juick/www/PageTemplates.java b/juick-www/src/main/java/com/juick/www/PageTemplates.java index 0bb17ff0..c570ae7f 100644 --- a/juick-www/src/main/java/com/juick/www/PageTemplates.java +++ b/juick-www/src/main/java/com/juick/www/PageTemplates.java @@ -191,9 +191,9 @@ public class PageTemplates { public static String formatTags(List tags) { String ret = ""; for (Tag tag : tags) { - String tagName = tag.Name.replaceAll("<", "<").replaceAll(">", ">"); + String tagName = tag.getName().replaceAll("<", "<").replaceAll(">", ">"); try { - ret += " *"; + String head = ""; if (paramTag != null && TagQueries.getTagNoIndex(sql, paramTag.TID)) { head += ""; } else if (paramBefore > 0 || paramShow != null) { @@ -128,7 +129,9 @@ public class User { out.println("
"); if (paramTag != null) { - out.println("

← Все записи с тегом " + Utils.encodeHTML(paramTag.Name) + "

"); + out.println("

← Все записи с тегом " + + Utils.encodeHTML(paramTag.getName()) + "

"); } PageTemplates.printMessages(out, sql, user, mids, visitor, visitor.getUID() == 0 ? 4 : 5, 0); @@ -139,7 +142,7 @@ public class User { nextpage += "&show=" + paramShow; } if (paramTag != null) { - nextpage += "&tag=" + URLEncoder.encode(paramTag.Name, "UTF-8"); + nextpage += "&tag=" + URLEncoder.encode(paramTag.getName(), "UTF-8"); } if (paramSearch != null) { nextpage += "&search=" + URLEncoder.encode(paramSearch, "UTF-8"); @@ -323,9 +326,9 @@ public class User { String ret = ""; int count = cnt > 0 ? Math.min(tags.size(), cnt) : tags.size(); for (int i = 0; i < count; i++) { - String tag = Utils.encodeHTML(tags.get(i).Name); + String tag = Utils.encodeHTML(tags.get(i).getName()); try { - tag = "" + tag + ""; } catch (UnsupportedEncodingException e) { } -- cgit v1.2.3