質問するログイン新規登録

回答編集履歴

1

変更

2025/07/21 10:15

投稿

YTS
YTS

スコア3

answer CHANGED
@@ -2,4 +2,49 @@
2
2
  以前お話しした通り、そもそもサーブレットの理解が誤っていたためサーブレット側が動いていないという誤認をしていましたが、jsp側でurlをpost送信できていないだけでした
3
3
 
4
4
  なのでjspがわでボタンを追加し、ボタンを押下したときpost送信できるようにformを追加しました
5
+ 質問時とはコードの内容変更してありますが、参照として残しておきます
6
+ ~~~
7
+ <%@ page language="java" contentType="text/html; charset=UTF-8"
8
+ pageEncoding="UTF-8"%>
9
+ <%@ page import="java.util.List"%>
10
+ <%@ page import="java.util.ArrayList"%>
11
+ <!DOCTYPE html>
12
+ <html>
13
+ <head>
14
+ <meta charset="utf-8">
15
+ <title>report</title>
16
+ <link rel="stylesheet" href="style.css">
17
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
18
+ <script
19
+ src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.2.0/chart.min.js"></script>
20
+ </head>
21
+ <body>
5
22
 
23
+ <jsp:include page="header.jsp">
24
+ <jsp:param name="title" value="report" />
25
+ </jsp:include>
26
+
27
+ <form action="report_week" method="post">
28
+ <p>
29
+ <input type="hidden" name="loginId_week" id="hiddenLoginid_week"
30
+ value="${loginid_week}">
31
+ </p>
32
+ <p>
33
+ <input type="submit" value="週生成" id="createBtn_week">
34
+ </p>
35
+ </form>
36
+
37
+ <form action="report_month" method="post">
38
+ <p>
39
+ <input type="hidden" name="loginId_month" id="hiddenLoginid_month"
40
+ value="${loginid_month}">
41
+ </p>
42
+ <p>
43
+ <input type="submit" value="月生成" id="createBtn_month">
44
+ </p>
45
+ </form>
46
+
47
+ </body>
48
+ </html>
49
+
50
+ ~~~