質問編集履歴

2

2021/06/11 13:04

投稿

Opqrst
Opqrst

スコア0

test CHANGED
File without changes
test CHANGED
@@ -9,6 +9,14 @@
9
9
  < form action = “相対パス”> の相対パスの部分にいろいろ入れてみましたが、404や405エラーが出てしまいます。
10
10
 
11
11
  (servlet,/servlet,./servlet,../servlet,sample/servlet等入れてみました。)
12
+
13
+
14
+
15
+ URLはhttp://localhost:8080/book/sample.jspで表示できています。
16
+
17
+ フォームに入力後は、
18
+
19
+ http://localhost:8080/book/servletと表示され、405エラーが出てしまいます。(相対パスがform action = “servlet”の場合)
12
20
 
13
21
 
14
22
 

1

2021/06/11 13:04

投稿

Opqrst
Opqrst

スコア0

test CHANGED
File without changes
test CHANGED
@@ -20,13 +20,21 @@
20
20
 
21
21
  web.xml (WebContent¥WEB-INF内)
22
22
 
23
+ <servlet>
24
+
23
25
  <servlet-name>servlet</servlet-name>
24
26
 
25
27
  <servlet-class>sample.ServletA</servlet-class>
26
28
 
29
+ </servlet>
30
+
31
+ <servlet-mapping>
32
+
27
33
  <servlet-name>servlet</servlet-name>
28
34
 
29
35
  <URL-pattern>/servlet</URL-pattern >
36
+
37
+ </servlet-mapping>
30
38
 
31
39
 
32
40