Mercurial > hg > Members > nobuyasu > jungle-network
view src/jungle/app/bbs/CreateBoardServlet.java @ 66:29127ac788a6
move some files
author | one |
---|---|
date | Tue, 20 Aug 2013 17:38:09 +0900 |
parents | src/jungle/test/bbs/CreateBoardServlet.java@d8ee57a1c2c6 |
children |
line wrap: on
line source
package jungle.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); } } }