Mercurial > hg > Members > nobuyasu > jungle-network
view src/main/java/app/bbs/thinks/CreateNode.java @ 173:d483caeabffc
change request id
author | tatsuki |
---|---|
date | Wed, 30 Jul 2014 17:17:08 +0900 |
parents | df063cf6f3b5 |
children | e30880a72909 |
line wrap: on
line source
package app.bbs.thinks; import java.io.PrintWriter; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import app.bbs.NetworkBulletinBoard; public class CreateNode extends HttpServlet { private final NetworkBulletinBoard bbs; private static final String PARAM_BOARD_NAME = "bname"; private static final String PARAM_BOARD_AUTHOR = "author"; private static final String PARAM_NODE_NAME = "name"; private static final String PARAM_BOARD_EDITKEY = "key"; private static final String PARAM_BOARD_PATH = "path"; private static final long serialVersionUID = 1L; public CreateNode(NetworkBulletinBoard _bbs) { bbs = _bbs; } public void doPost(HttpServletRequest _req, HttpServletResponse _res) { 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); PrintWriter pw = _res.getWriter(); pw.write("successfully written"); } catch (Exception _e) { _res.setStatus(500); } } }