Mercurial > hg > Members > nobuyasu > jungle-network
changeset 175:066f58e93a14
remove StringEscapeUtils.unescapeHtml
author | tatsuki |
---|---|
date | Wed, 30 Jul 2014 17:57:18 +0900 |
parents | e30880a72909 |
children | ac7d1070f449 |
files | src/main/java/app/bbs/ShowMessageWithTimeStampServlet.java src/main/java/app/bbs/thinks/CreateNode.java src/main/java/app/bbs/thinks/EditAttributeServlet.java src/main/java/app/bbs/thinks/EditNodeName.java src/main/java/app/bbs/thinks/ShowMatrix.java src/main/java/app/bbs/thinks/createAttributeMatrix.java src/main/java/app/bbs/thinks/deleteAttributeServlet.java src/main/java/app/bbs/thinks/deleteNodeServlet.java |
diffstat | 8 files changed, 79 insertions(+), 64 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/app/bbs/ShowMessageWithTimeStampServlet.java Wed Jul 30 17:46:58 2014 +0900 +++ b/src/main/java/app/bbs/ShowMessageWithTimeStampServlet.java Wed Jul 30 17:57:18 2014 +0900 @@ -33,7 +33,7 @@ } public void doGet(HttpServletRequest _req, HttpServletResponse _res) { - final String bname = StringEscapeUtils.unescapeHtml(_req.getParameter(PARAM_BOARD_NAME)); + final String bname = (_req.getParameter(PARAM_BOARD_NAME)); try { _res.setCharacterEncoding("UTF-8"); printBoard(bname, _res.getWriter());
--- a/src/main/java/app/bbs/thinks/CreateNode.java Wed Jul 30 17:46:58 2014 +0900 +++ b/src/main/java/app/bbs/thinks/CreateNode.java Wed Jul 30 17:57:18 2014 +0900 @@ -24,11 +24,11 @@ } public void doPost(HttpServletRequest _req, HttpServletResponse _res) { - String boardName = StringEscapeUtils.unescapeHtml(_req.getParameter(PARAM_BOARD_NAME)); - String author = StringEscapeUtils.unescapeHtml(_req.getParameter(PARAM_BOARD_AUTHOR));//not use - String nodeName = StringEscapeUtils.unescapeHtml(_req.getParameter(PARAM_NODE_NAME)); - String key = StringEscapeUtils.unescapeHtml(_req.getParameter(PARAM_BOARD_EDITKEY));//not use - String nodeNum = StringEscapeUtils.unescapeHtml(_req.getParameter(PARAM_BOARD_PATH)); + String boardName = (_req.getParameter(PARAM_BOARD_NAME)); + String author = (_req.getParameter(PARAM_BOARD_AUTHOR));//not use + String nodeName = (_req.getParameter(PARAM_NODE_NAME)); + String key = (_req.getParameter(PARAM_BOARD_EDITKEY));//not use + String nodeNum = (_req.getParameter(PARAM_BOARD_PATH)); try { bbs.createFolder(boardName, author, nodeName, key, nodeNum);
--- a/src/main/java/app/bbs/thinks/EditAttributeServlet.java Wed Jul 30 17:46:58 2014 +0900 +++ b/src/main/java/app/bbs/thinks/EditAttributeServlet.java Wed Jul 30 17:57:18 2014 +0900 @@ -28,9 +28,9 @@ public void doGet(HttpServletRequest _req,HttpServletResponse _res) { - String bname = StringEscapeUtils.unescapeHtml(_req.getParameter(PARAM_BOARD_NAME)); - String path = StringEscapeUtils.unescapeHtml(_req.getParameter(PARAM_NODE_ID)); - String id = StringEscapeUtils.unescapeHtml(_req.getParameter(PARAM_NODE_ID)); + String bname = (_req.getParameter(PARAM_BOARD_NAME)); + String path = (_req.getParameter(PARAM_NODE_ID)); + String id = (_req.getParameter(PARAM_NODE_ID)); try{ @@ -52,10 +52,10 @@ public void doPost(HttpServletRequest _req,HttpServletResponse _res) { - String boardName = StringEscapeUtils.unescapeHtml(_req.getParameter(PARAM_BOARD_NAME)); - String msg = StringEscapeUtils.unescapeHtml(_req.getParameter(PARAM_BOARD_MESSAGE)); - String path = StringEscapeUtils.unescapeHtml(_req.getParameter(PARAM_NODE_ID)); - String id = StringEscapeUtils.unescapeHtml(_req.getParameter(PARAM_NODE_ID)); + String boardName = (_req.getParameter(PARAM_BOARD_NAME)); + String msg = (_req.getParameter(PARAM_BOARD_MESSAGE)); + String path = (_req.getParameter(PARAM_NODE_ID)); + String id = (_req.getParameter(PARAM_NODE_ID)); try{ bbs.editAttribute(boardName, path,id, msg);
--- a/src/main/java/app/bbs/thinks/EditNodeName.java Wed Jul 30 17:46:58 2014 +0900 +++ b/src/main/java/app/bbs/thinks/EditNodeName.java Wed Jul 30 17:57:18 2014 +0900 @@ -28,8 +28,8 @@ public void doGet(HttpServletRequest _req,HttpServletResponse _res) { - String bname = StringEscapeUtils.unescapeHtml(_req.getParameter(PARAM_BOARD_NAME)); - String path = StringEscapeUtils.unescapeHtml(_req.getParameter(PARAM_NODE_PATH)); + String bname = (_req.getParameter(PARAM_BOARD_NAME)); + String path = (_req.getParameter(PARAM_NODE_PATH)); try{ @@ -51,11 +51,11 @@ public void doPost(HttpServletRequest _req,HttpServletResponse _res) { - String boardName = StringEscapeUtils.unescapeHtml(_req.getParameter(PARAM_BOARD_NAME)); - String author = StringEscapeUtils.unescapeHtml(_req.getParameter(PARAM_BOARD_AUTHOR)); - String msg = StringEscapeUtils.unescapeHtml(_req.getParameter(PARAM_BOARD_MESSAGE)); - String key = StringEscapeUtils.unescapeHtml(_req.getParameter(PARAM_BOARD_EDITKEY)); - String path = StringEscapeUtils.unescapeHtml(_req.getParameter(PARAM_NODE_PATH)); + String boardName = (_req.getParameter(PARAM_BOARD_NAME)); + String author = (_req.getParameter(PARAM_BOARD_AUTHOR)); + String msg = (_req.getParameter(PARAM_BOARD_MESSAGE)); + String key = (_req.getParameter(PARAM_BOARD_EDITKEY)); + String path = (_req.getParameter(PARAM_NODE_PATH)); try{ bbs.editMessage(boardName, path, author, msg, key);
--- a/src/main/java/app/bbs/thinks/ShowMatrix.java Wed Jul 30 17:46:58 2014 +0900 +++ b/src/main/java/app/bbs/thinks/ShowMatrix.java Wed Jul 30 17:57:18 2014 +0900 @@ -23,14 +23,17 @@ private final String showMatrixPath; private final String createAttributePath; private final String editAttributePath; - private final String deleteAttributePath; - private final String deleteNodePath; + private final String deleteAttributePath; + private final String deleteNodePath; private static final String PARAM_BOARD_NAME = "bname"; private static final String PARAM_NODE_PATH = "uuid"; - private static final String PARAM_NODE_NAME = "name"; + private static final String PARAM_NODE_NAME = "nodeName"; + public ShowMatrix(NetworkBulletinBoard _bbs, String _createBoardMessagePath, String _editNodePath, - String _showMatrixPath, String _createAttributePath, String _editAttributePath, String _deleteAttributePath, String _deleteNodePath, ThreadPool thp) { + String _showMatrixPath, String _createAttributePath, + String _editAttributePath, String _deleteAttributePath, + String _deleteNodePath, ThreadPool thp) { bbs = _bbs; deleteAttributePath = _deleteAttributePath; deleteNodePath = _deleteNodePath; @@ -42,9 +45,9 @@ } public void doGet(HttpServletRequest _req, HttpServletResponse _res) { - final String bname = StringEscapeUtils.unescapeHtml(_req.getParameter(PARAM_BOARD_NAME)); - String path = StringEscapeUtils.unescapeHtml(_req.getParameter(PARAM_NODE_PATH)); - String nodeName = StringEscapeUtils.unescapeHtml(_req.getParameter(PARAM_NODE_NAME)); + final String bname = _req.getParameter(PARAM_BOARD_NAME); + String path = _req.getParameter(PARAM_NODE_PATH); + String nodeName = _req.getParameter(PARAM_NODE_NAME); try { _res.setCharacterEncoding("UTF-8"); printBoard(bname, path, nodeName, _res.getWriter()); @@ -53,18 +56,19 @@ } } - private void printBoard(String _bname, String path, String nodeName, PrintWriter _pw) - throws Exception { + private void printBoard(String _bname, String path, String nodeName, + PrintWriter _pw) throws Exception { _pw.write("<html><body>\n"); - - if(nodeName == null ) - nodeName = "rootNode" ; - - - _pw.write("<h1>" + nodeName + " Path = " + path + "</h1>\n"); - - _pw.write("<form action='" + createBoardMessagePath + "' method='POST'>\n"); - _pw.write("<p><input type='hidden' name='bname' value='" + _bname + "'/> </p>\n"); + + if (nodeName == null) + nodeName = "rootNode"; + + _pw.write("<h1>" + nodeName + " Path = " + path + "</h1>\n"); + + _pw.write("<form action='" + createBoardMessagePath + + "' method='POST'>\n"); + _pw.write("<p><input type='hidden' name='bname' value='" + _bname + + "'/> </p>\n"); _pw.write("<p>Folder Name<br/> <input type='textarea' name='name'/> </p>\n"); _pw.write("<input type='hidden' name='path' value='" + path + "'/>"); _pw.write("<p><input type='submit' value='submit'/></p>\n"); @@ -72,7 +76,8 @@ _pw.write("<p><br>add Attribute</p>"); _pw.write("<form action='" + createAttributePath + "' method='POST'\n"); - _pw.write("<p><input type='hidden' name='bname' value='" + _bname + "'</p>\n"); + _pw.write("<p><input type='hidden' name='bname' value='" + _bname + + "'</p>\n"); _pw.write("<p>attributeName<br/> <input type='textarea' name='msg'/> </p>\n"); _pw.write("<input type='hidden' name='path' value='" + path + "'/>"); _pw.write("<p><input type='submit' value='submit'/></p>\n"); @@ -81,20 +86,30 @@ _pw.write("<p>Folder</p>"); for (BoardMessage msg : bbs.getFolder(_bname, path)) { - _pw.write("<small><a href=" + showMatrixPath + "?bname=" + _bname + "&uuid=" + path + "/" + msg.getUUID() + "&nodeName=" + msg.getMessage() + ">" + msg.getMessage() + "</a></small>"); - _pw.write(" "); - _pw.write("<small><a href='" + editNodePath + "?bname=" + _bname + "&path=" + path + "/"+ msg.getUUID() + "'>edit</a></small>"); + _pw.write("<small><a href=" + showMatrixPath + "?bname=" + _bname + + "&uuid=" + path + "/" + msg.getUUID() + "&nodeName=" + + msg.getMessage() + ">" + msg.getMessage() + + "</a></small>"); _pw.write(" "); - _pw.write("<small><a href='" + deleteNodePath + "?bname=" + _bname + "&path=" + path + "&id=" + msg.getUUID() + "'>delete</a><br><br></small>"); + _pw.write("<small><a href='" + editNodePath + "?bname=" + _bname + + "&path=" + path + "/" + msg.getUUID() + + "'>edit</a></small>"); + _pw.write(" "); + _pw.write("<small><a href='" + deleteNodePath + "?bname=" + _bname + + "&path=" + path + "&id=" + msg.getUUID() + + "'>delete</a><br><br></small>"); } - - + _pw.write("<br><hr/><p>Value</p>"); getAttributeImp attribute = (bbs.getAttribute(_bname, path)); for (int count = 0; attribute.getMessage(count) != null; count++) { _pw.write("<p><b>" + count + " : </b>"); - _pw.write("<a href='" + editAttributePath + "?bname=" + _bname + "&path=" + path + "&id="+ count + "'>" + attribute.getMessage(count) + "</a>"); - _pw.write("<a href='" + deleteAttributePath + "?bname=" + _bname + "&path=" + path + "&id="+ count + "'>" + " delete" + "</a></p>"); + _pw.write("<a href='" + editAttributePath + "?bname=" + _bname + + "&path=" + path + "&id=" + count + "'>" + + attribute.getMessage(count) + "</a>"); + _pw.write("<a href='" + deleteAttributePath + "?bname=" + _bname + + "&path=" + path + "&id=" + count + "'>" + " delete" + + "</a></p>"); } _pw.write("</body></html>"); _pw.flush();
--- a/src/main/java/app/bbs/thinks/createAttributeMatrix.java Wed Jul 30 17:46:58 2014 +0900 +++ b/src/main/java/app/bbs/thinks/createAttributeMatrix.java Wed Jul 30 17:57:18 2014 +0900 @@ -30,11 +30,11 @@ public void doPost(HttpServletRequest _req,HttpServletResponse _res) { - String boardName = StringEscapeUtils.unescapeHtml(_req.getParameter(PARAM_BOARD_NAME)); - String author = StringEscapeUtils.unescapeHtml(_req.getParameter(PARAM_BOARD_AUTHOR));//not use - String msg = StringEscapeUtils.unescapeHtml(_req.getParameter(PARAM_BOARD_MESSAGE)); - String key = StringEscapeUtils.unescapeHtml(_req.getParameter(PARAM_BOARD_EDITKEY)); // not use - String uuid = StringEscapeUtils.unescapeHtml(_req.getParameter(PARAM_NODE_PATH)); + String boardName = (_req.getParameter(PARAM_BOARD_NAME)); + String author = (_req.getParameter(PARAM_BOARD_AUTHOR));//not use + String msg = (_req.getParameter(PARAM_BOARD_MESSAGE)); + String key = (_req.getParameter(PARAM_BOARD_EDITKEY)); // not use + String uuid = (_req.getParameter(PARAM_NODE_PATH)); try{ bbs.createAttribute(boardName, uuid, author, msg, key); PrintWriter pw = _res.getWriter();
--- a/src/main/java/app/bbs/thinks/deleteAttributeServlet.java Wed Jul 30 17:46:58 2014 +0900 +++ b/src/main/java/app/bbs/thinks/deleteAttributeServlet.java Wed Jul 30 17:57:18 2014 +0900 @@ -28,9 +28,9 @@ public void doGet(HttpServletRequest _req,HttpServletResponse _res) { - String bname = StringEscapeUtils.unescapeHtml(_req.getParameter(PARAM_BOARD_NAME)); - String path = StringEscapeUtils.unescapeHtml(_req.getParameter(PARAM_NODE_ID)); - String id = StringEscapeUtils.unescapeHtml(_req.getParameter(PARAM_NODE_ID)); + String bname = (_req.getParameter(PARAM_BOARD_NAME)); + String path = (_req.getParameter(PARAM_NODE_ID)); + String id = (_req.getParameter(PARAM_NODE_ID)); try{ @@ -51,9 +51,9 @@ public void doPost(HttpServletRequest _req,HttpServletResponse _res) { - String boardName = StringEscapeUtils.unescapeHtml(_req.getParameter(PARAM_BOARD_NAME)); - String path = StringEscapeUtils.unescapeHtml(_req.getParameter(PARAM_NODE_ID)); - String id = StringEscapeUtils.unescapeHtml(_req.getParameter(PARAM_NODE_ID)); + String boardName = (_req.getParameter(PARAM_BOARD_NAME)); + String path = (_req.getParameter(PARAM_NODE_ID)); + String id = (_req.getParameter(PARAM_NODE_ID)); try{ bbs.deleteAttribute(boardName, path,id);
--- a/src/main/java/app/bbs/thinks/deleteNodeServlet.java Wed Jul 30 17:46:58 2014 +0900 +++ b/src/main/java/app/bbs/thinks/deleteNodeServlet.java Wed Jul 30 17:57:18 2014 +0900 @@ -25,9 +25,9 @@ public void doGet(HttpServletRequest _req,HttpServletResponse _res) { - String bname = StringEscapeUtils.unescapeHtml(_req.getParameter(PARAM_BOARD_NAME)); - String path = StringEscapeUtils.unescapeHtml(_req.getParameter(PARAM_BOARD_PATH )); - String id = StringEscapeUtils.unescapeHtml(_req.getParameter(PARAM_NODE_ID)); + String bname = (_req.getParameter(PARAM_BOARD_NAME)); + String path = (_req.getParameter(PARAM_BOARD_PATH )); + String id = (_req.getParameter(PARAM_NODE_ID)); try{ _res.setCharacterEncoding("UTF-8"); @@ -47,9 +47,9 @@ public void doPost(HttpServletRequest _req,HttpServletResponse _res) { - String boardName = StringEscapeUtils.unescapeHtml(_req.getParameter(PARAM_BOARD_NAME)); - String path = StringEscapeUtils.unescapeHtml(_req.getParameter(PARAM_BOARD_PATH)); - String id = StringEscapeUtils.unescapeHtml(_req.getParameter(PARAM_NODE_ID)); + String boardName = (_req.getParameter(PARAM_BOARD_NAME)); + String path = (_req.getParameter(PARAM_BOARD_PATH)); + String id = (_req.getParameter(PARAM_NODE_ID)); try{ bbs.deleteNode(boardName, path, id); PrintWriter pw = _res.getWriter();