Mercurial > hg > Database > jungle-network
comparison src/main/java/app/bbs/thinks/EditNodeName.java @ 172:d483caeabffc
change request id
author | tatsuki |
---|---|
date | Wed, 30 Jul 2014 17:17:08 +0900 |
parents | 2403b9a4416f |
children | e30880a72909 |
comparison
equal
deleted
inserted
replaced
171:00c3cca1903c | 172:d483caeabffc |
---|---|
10 | 10 |
11 public class EditNodeName extends HttpServlet | 11 public class EditNodeName extends HttpServlet |
12 { | 12 { |
13 private final BulletinBoard bbs; | 13 private final BulletinBoard bbs; |
14 private static final String PARAM_BOARD_NAME = "bname"; | 14 private static final String PARAM_BOARD_NAME = "bname"; |
15 private static final String PARAM_BOARD_MSGID = "uuid"; | 15 private static final String PARAM_NODE_PATH = "path"; |
16 private static final String PARAM_BOARD_AUTHOR = "author"; | 16 private static final String PARAM_BOARD_AUTHOR = "author"; |
17 private static final String PARAM_BOARD_MESSAGE= "msg"; | 17 private static final String PARAM_BOARD_MESSAGE= "msg"; |
18 private static final String PARAM_BOARD_EDITKEY = "key"; | 18 private static final String PARAM_BOARD_EDITKEY = "key"; |
19 | 19 |
20 private static final long serialVersionUID = 1L; | 20 private static final long serialVersionUID = 1L; |
25 } | 25 } |
26 | 26 |
27 public void doGet(HttpServletRequest _req,HttpServletResponse _res) | 27 public void doGet(HttpServletRequest _req,HttpServletResponse _res) |
28 { | 28 { |
29 String bname = _req.getParameter(PARAM_BOARD_NAME); | 29 String bname = _req.getParameter(PARAM_BOARD_NAME); |
30 String uuid = _req.getParameter(PARAM_BOARD_MSGID); | 30 String path = _req.getParameter(PARAM_NODE_PATH); |
31 | 31 |
32 | 32 |
33 try{ | 33 try{ |
34 PrintWriter pw = _res.getWriter(); | 34 PrintWriter pw = _res.getWriter(); |
35 pw.write("<html><body><h1>edit message</h1>"); | 35 pw.write("<html><body><h1>edit message</h1>"); |
36 pw.write("<form method='POST'\n"); | 36 pw.write("<form method='POST'\n"); |
37 pw.write("<p><input type='hidden' name='author'/>" + | 37 pw.write("<p><input type='hidden' name='author'/>" + |
38 "<input type='hidden' name='key' value='"+uuid+"'/>" + | 38 "<input type='hidden' name='key' value='"+path+"'/>" + |
39 "<input type='hidden' name='bname' value='"+bname+"'</p>\n"); | 39 "<input type='hidden' name='bname' value='"+bname+"'</p>\n"); |
40 pw.write("<p>Message<br/> <input type='textarea' name='msg'/> </p>\n"); | 40 pw.write("<p>Message<br/> <input type='textarea' name='msg'/> </p>\n"); |
41 pw.write("<p><input type='submit' value='submit'/></p>\n"); | 41 pw.write("<p><input type='submit' value='submit'/></p>\n"); |
42 pw.write("</body></html>"); | 42 pw.write("</body></html>"); |
43 pw.flush(); | 43 pw.flush(); |
50 { | 50 { |
51 String boardName = _req.getParameter(PARAM_BOARD_NAME); | 51 String boardName = _req.getParameter(PARAM_BOARD_NAME); |
52 String author = _req.getParameter(PARAM_BOARD_AUTHOR); | 52 String author = _req.getParameter(PARAM_BOARD_AUTHOR); |
53 String msg = _req.getParameter(PARAM_BOARD_MESSAGE); | 53 String msg = _req.getParameter(PARAM_BOARD_MESSAGE); |
54 String key = _req.getParameter(PARAM_BOARD_EDITKEY); | 54 String key = _req.getParameter(PARAM_BOARD_EDITKEY); |
55 String uuid = _req.getParameter(PARAM_BOARD_MSGID); | 55 String path = _req.getParameter(PARAM_NODE_PATH); |
56 | 56 |
57 try{ | 57 try{ |
58 bbs.editMessage(boardName, uuid, author, msg, key); | 58 bbs.editMessage(boardName, path, author, msg, key); |
59 PrintWriter pw = _res.getWriter(); | 59 PrintWriter pw = _res.getWriter(); |
60 pw.write("successfully written"); | 60 pw.write("successfully written"); |
61 pw.flush(); | 61 pw.flush(); |
62 }catch(Exception _e){ | 62 }catch(Exception _e){ |
63 _res.setStatus(500); | 63 _res.setStatus(500); |