質問編集履歴

1

修正

2019/05/08 03:26

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -29,135 +29,3 @@
29
29
 
30
30
 
31
31
  ご指摘お願いします。
32
-
33
-
34
-
35
- ```ここに言語名を入力
36
-
37
- java eclipse使用
38
-
39
-
40
-
41
- ソースコード
42
-
43
- ```
44
-
45
- package org.mypackage.sample;
46
-
47
-
48
-
49
- import java.io.IOException;
50
-
51
- import java.io.PrintWriter;
52
-
53
-
54
-
55
- import javax.servlet.ServletException;
56
-
57
- import javax.servlet.annotation.WebServlet;
58
-
59
- import javax.servlet.http.HttpServlet;
60
-
61
- import javax.servlet.http.HttpServletRequest;
62
-
63
- import javax.servlet.http.HttpServletResponse;
64
-
65
-
66
-
67
- /**
68
-
69
- * Servlet implementation class Method4
70
-
71
- */
72
-
73
- @WebServlet("/Method4")
74
-
75
- public class Method4 extends HttpServlet {
76
-
77
- private static final long serialVersionUID = 1L;
78
-
79
-
80
-
81
- /**
82
-
83
- * @see HttpServlet#HttpServlet()
84
-
85
- */
86
-
87
- public Method4() {
88
-
89
- super();
90
-
91
- // TODO Auto-generated constructor stub
92
-
93
- }
94
-
95
-
96
-
97
- /**
98
-
99
- * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
100
-
101
- */
102
-
103
-
104
-
105
- /*メソッド*/
106
-
107
- boolean calculation(int num){
108
-
109
- boolean num=100+300;
110
-
111
-
112
-
113
- return num;
114
-
115
- }
116
-
117
-
118
-
119
- protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
120
-
121
- // TODO Auto-generated method stub
122
-
123
- response.setContentType("text/html;charset=UTF-8");
124
-
125
- try (PrintWriter out = response.getWriter()) {
126
-
127
- /* boolean num= calculation(); */
128
-
129
-
130
-
131
- if (calculation(num)) {
132
-
133
- out.print("200以上です。");
134
-
135
- }
136
-
137
-
138
-
139
- }
140
-
141
-
142
-
143
- }
144
-
145
-
146
-
147
- /**
148
-
149
- * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
150
-
151
- */
152
-
153
- protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
154
-
155
- // TODO Auto-generated method stub
156
-
157
- doGet(request, response);
158
-
159
- }
160
-
161
-
162
-
163
- }