Mercurial > hg > Members > nobuyasu > jungle-network
comparison src/main/java/app/bbs/thinks/permission.java @ 186:ef5045af0753
add permission .java
author | tatsuki |
---|---|
date | Tue, 16 Sep 2014 07:49:14 +0900 |
parents | |
children | f9b26747ef63 |
comparison
equal
deleted
inserted
replaced
185:f54d4ab5df4b | 186:ef5045af0753 |
---|---|
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 org.eclipse.jetty.util.thread.ThreadPool; | |
10 | |
11 import app.bbs.NetworkBulletinBoard; | |
12 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.bbs.BoardMessage; | |
13 | |
14 import javax.servlet.http.HttpServletRequest; | |
15 import javax.servlet.http.HttpServletResponse; | |
16 | |
17 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.bbs.BoardMessage; | |
18 | |
19 import org.eclipse.jetty.util.thread.ThreadPool; | |
20 | |
21 import app.bbs.NetworkBulletinBoard; | |
22 | |
23 public class permission extends HttpServlet{ | |
24 private static final long serialVersionUID = 1L; | |
25 private final NetworkBulletinBoard bbs; | |
26 private static final String REQUEST_NAME = "name1"; | |
27 private static final String PERMMIT_NAME = "name2"; | |
28 | |
29 public permission(NetworkBulletinBoard _bbs, | |
30 String permissionPath, ThreadPool thp) { | |
31 bbs = _bbs; | |
32 | |
33 } | |
34 | |
35 public void doGet(HttpServletRequest _req, HttpServletResponse _res) { | |
36 | |
37 try { | |
38 _res.setCharacterEncoding("UTF-8"); | |
39 PrintWriter _pw = _res.getWriter(); | |
40 _pw.write("<h1>" + " 承認フォーム " + "</h1>\n"); | |
41 _pw.write("<html><body><h1>edit message</h1>"); | |
42 _pw.write("<form method='POST'\n"); | |
43 _pw.write("<p>申請者名<br/> <input type='textarea' name='name1'/> </p>\n"); | |
44 _pw.write("<p>承認者名<br/> <input type='textarea' name='name2'/> </p>\n"); | |
45 _pw.write("<p><input type='submit' value='submit'/></p>\n"); | |
46 _pw.write("</body></html>"); | |
47 _pw.flush(); | |
48 _res.setCharacterEncoding("UTF-8"); | |
49 } catch (Exception _e) { | |
50 _res.setStatus(500); | |
51 } | |
52 } | |
53 | |
54 public void doPost(HttpServletRequest _req,HttpServletResponse _res) | |
55 { | |
56 String requestName = _req.getParameter(REQUEST_NAME); | |
57 String permmitName = _req.getParameter(PERMMIT_NAME); | |
58 | |
59 try{ | |
60 _res.setCharacterEncoding("UTF-8"); | |
61 PrintWriter pw = _res.getWriter(); | |
62 pw.write(bbs.searchJungle(requestName,permmitName)); | |
63 pw.flush(); | |
64 }catch(Exception _e){ | |
65 _res.setStatus(500); | |
66 } | |
67 } | |
68 | |
69 } |