質問編集履歴
2
投稿の時に誤ったコードを記載してしまいました。修正しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -52,7 +52,7 @@
|
|
52
52
|
|
53
53
|
|
54
54
|
|
55
|
-
String data=req.getParameter("data");
|
55
|
+
String[] data=req.getParameterValues("data");
|
56
56
|
|
57
57
|
res.setContentType("text/plain; charset=utf-8");
|
58
58
|
|
1
追記依頼に対して編集しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -9,6 +9,28 @@
|
|
9
9
|
困っています。アドバイスよろしくお願いします。
|
10
10
|
|
11
11
|
|
12
|
+
|
13
|
+
http://localhost/post.phpをたたきます。
|
14
|
+
|
15
|
+
中で、http://localhost:8080/app/testにHTTP-POSTしています。
|
16
|
+
|
17
|
+
しかしnullになって、"data is empty"が表示されます。
|
18
|
+
|
19
|
+
post.phpのurlをpostcheck.phpにすると、'a'が表示されます。
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
http://localhost/form.htmlをたたいた場合にはservletは
|
24
|
+
|
25
|
+
正しく、'data is a'を返します。
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
よろしくお願いします。
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
http://localhost:8080/app/test
|
12
34
|
|
13
35
|
```Java
|
14
36
|
|
@@ -52,6 +74,8 @@
|
|
52
74
|
|
53
75
|
```
|
54
76
|
|
77
|
+
http://localhost/post.php
|
78
|
+
|
55
79
|
```PHP
|
56
80
|
|
57
81
|
$data=array('data'=>array('a','b'));
|
@@ -80,6 +104,8 @@
|
|
80
104
|
|
81
105
|
```
|
82
106
|
|
107
|
+
$url='http://localhost/postcheck.php';
|
108
|
+
|
83
109
|
```PHP
|
84
110
|
|
85
111
|
<?php
|
@@ -89,6 +115,8 @@
|
|
89
115
|
?>
|
90
116
|
|
91
117
|
```
|
118
|
+
|
119
|
+
http://localhost/form.html
|
92
120
|
|
93
121
|
```HTML
|
94
122
|
|