Теги:
"); + printUserTags(out, visitor); + out.println(""); + for (int i = 0; i < tags.size(); i++) { + if (i > 0) { + out.print(" "); + } + String taglink = StringUtils.EMPTY; + try { + taglink = "" + StringEscapeUtils.escapeHtml4(tags.get(i).getTag().getName()) + ""; + } catch (UnsupportedEncodingException e) { + } + int usagecnt = tags.get(i).getUsageCount(); + if (usagecnt <= max / 5 + min) { + out.print("" + taglink + ""); + } else if (usagecnt <= max / 5 * 2 + min) { + out.print(taglink); + } else if (usagecnt <= max / 5 * 3 + min) { + out.print("" + taglink + ""); + } else if (usagecnt <= max / 5 * 4 + min) { + out.print("" + taglink + ""); + } else { + out.print("" + taglink + ""); + } + } + out.println("
"); + } + + @RequestMapping(value = "/post", method = RequestMethod.POST) + public void doPostMessage(HttpServletRequest request, HttpServletResponse response, + @RequestParam(required = false) String img, + @RequestParam(required = false) MultipartFile attach) throws IOException { + com.juick.User visitor = webApp.getVisitorUser(request, response); + if (visitor.getUid() == 0) { + response.sendError(HttpServletResponse.SC_FORBIDDEN); + return; + } + String body = request.getParameter("body"); + if (body == null || body.length() < 1 || body.length() > 4096) { + response.sendError(HttpServletResponse.SC_BAD_REQUEST); + return; + } + body = body.replace("\r", StringUtils.EMPTY); + + ListПоделитесь своим новым постом в социальных сетях:
"); + if (crosspostService.getTwitterTokens(visitor.getUid()).isPresent()) { + out.println(" "); + } + out.println(" "); + out.println(" "); + if (crosspostService.getFacebookToken(visitor.getUid()).isPresent()) { + out.println(" "); + } + out.println(" "); + out.println("Ссылка на сообщение: http://juick.com/" + mid + "
"); + out.println("