165
|
1 package app.bbs.thinks;
|
|
2
|
|
3 import java.io.PrintWriter;
|
|
4
|
|
5 import javax.servlet.http.HttpServlet;
|
|
6 import javax.servlet.http.HttpServletRequest;
|
|
7 import javax.servlet.http.HttpServletResponse;
|
|
8
|
|
9 import app.bbs.NetworkBulletinBoard;
|
|
10
|
|
11 public class createAttributeMatrix extends HttpServlet
|
|
12 {
|
|
13 private final NetworkBulletinBoard bbs;
|
|
14 private static final String PARAM_BOARD_NAME = "bname";
|
172
|
15 private static final String PARAM_NODE_PATH = "path";
|
165
|
16 private static final String PARAM_BOARD_AUTHOR = "author";
|
|
17 private static final String PARAM_BOARD_MESSAGE= "msg";
|
|
18 private static final String PARAM_BOARD_EDITKEY = "key";
|
|
19
|
|
20 private static final long serialVersionUID = 1L;
|
|
21
|
|
22 public createAttributeMatrix(NetworkBulletinBoard _bbs)
|
|
23 {
|
|
24 bbs = _bbs;
|
|
25 }
|
|
26
|
|
27
|
|
28
|
|
29 public void doPost(HttpServletRequest _req,HttpServletResponse _res)
|
|
30 {
|
174
|
31 String boardName = (_req.getParameter(PARAM_BOARD_NAME));
|
|
32 String author = (_req.getParameter(PARAM_BOARD_AUTHOR));//not use
|
|
33 String msg = (_req.getParameter(PARAM_BOARD_MESSAGE));
|
|
34 String key = (_req.getParameter(PARAM_BOARD_EDITKEY)); // not use
|
|
35 String uuid = (_req.getParameter(PARAM_NODE_PATH));
|
165
|
36 try{
|
|
37 bbs.createAttribute(boardName, uuid, author, msg, key);
|
|
38 PrintWriter pw = _res.getWriter();
|
|
39 pw.write("successfully written");
|
|
40 pw.flush();
|
|
41 }catch(Exception _e){
|
|
42 _res.setStatus(500);
|
|
43 }
|
|
44 }
|
|
45 }
|