Mercurial > hg > Database > jungle-network
view src/main/java/app/bbs/CreateBoardServlet.java @ 112:8f9811a1e00c
Moved app files
author | one |
---|---|
date | Fri, 29 Nov 2013 04:31:22 +0900 (2013-11-28) |
parents | src/main/java/jungle/app/bbs/CreateBoardServlet.java@f9e29a52efd3 |
children |
line wrap: on
line source
package app.bbs; import java.io.PrintWriter; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class CreateBoardServlet extends HttpServlet { private final BulletinBoard bbs; private static final String PARAM_BOARD_NAME = "bname"; private static final String PARAM_BOARD_AUTHOR = "author"; private static final String PARAM_BOARD_INITMESSAGE= "msg"; private static final String PARAM_BOARD_EDITKEY = "key"; private static final long serialVersionUID = 1L; public CreateBoardServlet(BulletinBoard _bbs) { bbs = _bbs; } public void doPost(HttpServletRequest _req,HttpServletResponse _res) { String boardName = _req.getParameter(PARAM_BOARD_NAME); String author = _req.getParameter(PARAM_BOARD_AUTHOR); String msg = _req.getParameter(PARAM_BOARD_INITMESSAGE); String key = _req.getParameter(PARAM_BOARD_EDITKEY); try{ bbs.createBoards(boardName,author,msg,key); PrintWriter pw = _res.getWriter(); pw.write("successfully written"); }catch(Exception _e){ _res.setStatus(500); } } }