トップメニューから図書一覧への画面推移(formタグ使用)

This commit is contained in:
2026-09-18 14:20:41 +09:00
parent 4398b1554b
commit d841bc52e4
2 changed files with 14 additions and 10 deletions

View File

@@ -1,14 +1,15 @@
package com.example.demo.controller; package com.example.demo.controller;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping;
@Controller @Controller
public class BookController { public class BookController {
@GetMapping("/book") @PostMapping("/book")
public String book() { public String book() {
return "book"; return "book";
} }
} }

View File

@@ -9,16 +9,19 @@
メインメニュー メインメニュー
</h1> </h1>
<!-- ===== 共通:社内図書一覧 ===== --> <!-- ===== 共通:社内図書一覧 ===== -->
<a class="card" href="${pageContext.request.contextPath}/BookServlet"> <form method="post" name="社内図書一覧" action="book">
<a href="javascript:form1.submit()">リンク名</a>
<button type="submit" class="btn-book">
<h3>社内図書一覧</h3> <h3>社内図書一覧</h3>
<p> <p>
登録されている図書の<br> 一覧を表示します。 登録されている図書の<br> 一覧を表示します。
</p> </p>
</a> </button>
</form>
<hr> <!--区切り線--> <hr> <!--区切り線-->
<!-- ===== 共通:寄贈申請 ===== --> <!-- ===== 共通:寄贈申請 ===== -->