annotate src/main/java/app/bbs/thinks/createAttributeMatrix.java @ 174:066f58e93a14

remove StringEscapeUtils.unescapeHtml
author tatsuki
date Wed, 30 Jul 2014 17:57:18 +0900
parents e30880a72909
children 6f104ab4eb81
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
165
b3d5fbe95b9a Create Folder Method
tatsuki
parents:
diff changeset
1 package app.bbs.thinks;
b3d5fbe95b9a Create Folder Method
tatsuki
parents:
diff changeset
2
b3d5fbe95b9a Create Folder Method
tatsuki
parents:
diff changeset
3 import java.io.PrintWriter;
b3d5fbe95b9a Create Folder Method
tatsuki
parents:
diff changeset
4
b3d5fbe95b9a Create Folder Method
tatsuki
parents:
diff changeset
5 import javax.servlet.http.HttpServlet;
b3d5fbe95b9a Create Folder Method
tatsuki
parents:
diff changeset
6 import javax.servlet.http.HttpServletRequest;
b3d5fbe95b9a Create Folder Method
tatsuki
parents:
diff changeset
7 import javax.servlet.http.HttpServletResponse;
b3d5fbe95b9a Create Folder Method
tatsuki
parents:
diff changeset
8
173
e30880a72909 change servlet encode utf-8
tatsuki
parents: 172
diff changeset
9 import org.apache.commons.lang.StringEscapeUtils;
e30880a72909 change servlet encode utf-8
tatsuki
parents: 172
diff changeset
10
165
b3d5fbe95b9a Create Folder Method
tatsuki
parents:
diff changeset
11 import app.bbs.NetworkBulletinBoard;
b3d5fbe95b9a Create Folder Method
tatsuki
parents:
diff changeset
12
b3d5fbe95b9a Create Folder Method
tatsuki
parents:
diff changeset
13 public class createAttributeMatrix extends HttpServlet
b3d5fbe95b9a Create Folder Method
tatsuki
parents:
diff changeset
14 {
b3d5fbe95b9a Create Folder Method
tatsuki
parents:
diff changeset
15 private final NetworkBulletinBoard bbs;
b3d5fbe95b9a Create Folder Method
tatsuki
parents:
diff changeset
16 private static final String PARAM_BOARD_NAME = "bname";
172
d483caeabffc change request id
tatsuki
parents: 165
diff changeset
17 private static final String PARAM_NODE_PATH = "path";
165
b3d5fbe95b9a Create Folder Method
tatsuki
parents:
diff changeset
18 private static final String PARAM_BOARD_AUTHOR = "author";
b3d5fbe95b9a Create Folder Method
tatsuki
parents:
diff changeset
19 private static final String PARAM_BOARD_MESSAGE= "msg";
b3d5fbe95b9a Create Folder Method
tatsuki
parents:
diff changeset
20 private static final String PARAM_BOARD_EDITKEY = "key";
b3d5fbe95b9a Create Folder Method
tatsuki
parents:
diff changeset
21
b3d5fbe95b9a Create Folder Method
tatsuki
parents:
diff changeset
22 private static final long serialVersionUID = 1L;
b3d5fbe95b9a Create Folder Method
tatsuki
parents:
diff changeset
23
b3d5fbe95b9a Create Folder Method
tatsuki
parents:
diff changeset
24 public createAttributeMatrix(NetworkBulletinBoard _bbs)
b3d5fbe95b9a Create Folder Method
tatsuki
parents:
diff changeset
25 {
b3d5fbe95b9a Create Folder Method
tatsuki
parents:
diff changeset
26 bbs = _bbs;
b3d5fbe95b9a Create Folder Method
tatsuki
parents:
diff changeset
27 }
b3d5fbe95b9a Create Folder Method
tatsuki
parents:
diff changeset
28
b3d5fbe95b9a Create Folder Method
tatsuki
parents:
diff changeset
29
b3d5fbe95b9a Create Folder Method
tatsuki
parents:
diff changeset
30
b3d5fbe95b9a Create Folder Method
tatsuki
parents:
diff changeset
31 public void doPost(HttpServletRequest _req,HttpServletResponse _res)
b3d5fbe95b9a Create Folder Method
tatsuki
parents:
diff changeset
32 {
174
066f58e93a14 remove StringEscapeUtils.unescapeHtml
tatsuki
parents: 173
diff changeset
33 String boardName = (_req.getParameter(PARAM_BOARD_NAME));
066f58e93a14 remove StringEscapeUtils.unescapeHtml
tatsuki
parents: 173
diff changeset
34 String author = (_req.getParameter(PARAM_BOARD_AUTHOR));//not use
066f58e93a14 remove StringEscapeUtils.unescapeHtml
tatsuki
parents: 173
diff changeset
35 String msg = (_req.getParameter(PARAM_BOARD_MESSAGE));
066f58e93a14 remove StringEscapeUtils.unescapeHtml
tatsuki
parents: 173
diff changeset
36 String key = (_req.getParameter(PARAM_BOARD_EDITKEY)); // not use
066f58e93a14 remove StringEscapeUtils.unescapeHtml
tatsuki
parents: 173
diff changeset
37 String uuid = (_req.getParameter(PARAM_NODE_PATH));
165
b3d5fbe95b9a Create Folder Method
tatsuki
parents:
diff changeset
38 try{
b3d5fbe95b9a Create Folder Method
tatsuki
parents:
diff changeset
39 bbs.createAttribute(boardName, uuid, author, msg, key);
b3d5fbe95b9a Create Folder Method
tatsuki
parents:
diff changeset
40 PrintWriter pw = _res.getWriter();
b3d5fbe95b9a Create Folder Method
tatsuki
parents:
diff changeset
41 pw.write("successfully written");
b3d5fbe95b9a Create Folder Method
tatsuki
parents:
diff changeset
42 pw.flush();
b3d5fbe95b9a Create Folder Method
tatsuki
parents:
diff changeset
43 }catch(Exception _e){
b3d5fbe95b9a Create Folder Method
tatsuki
parents:
diff changeset
44 _res.setStatus(500);
b3d5fbe95b9a Create Folder Method
tatsuki
parents:
diff changeset
45 }
b3d5fbe95b9a Create Folder Method
tatsuki
parents:
diff changeset
46 }
b3d5fbe95b9a Create Folder Method
tatsuki
parents:
diff changeset
47 }