FR-01_全体反映なし

This commit is contained in:
m-shimizu
2026-10-20 13:17:15 +09:00
parent 0d582fee5c
commit c612e9dac3
4 changed files with 92 additions and 44 deletions

View File

@@ -51,10 +51,11 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-devtools</artifactId>
<artifactId>spring-boot-devtools</artifactId> <!-- ここを修正 -->
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>

View File

@@ -23,7 +23,7 @@ public class LoginController {
}
// ログイン画面表示
@GetMapping("/login")
@GetMapping("/")
public String showLogin() {
return "login";
}

View File

@@ -1,4 +1,5 @@
package com.example.demo.form;
/** 社員登録・編集フォーム */
public class EmployeeForm {
private Integer idEmployee;
@@ -10,24 +11,72 @@ public class EmployeeForm {
private String flgRetirement = "0";
public void trim() {
nmEmployee = t(nmEmployee); knEmployee = t(knEmployee); mailAddress = t(mailAddress);
flgAdmin = t(flgAdmin); flgRetirement = t(flgRetirement);
if (password == null) password = "";
nmEmployee = t(nmEmployee);
knEmployee = t(knEmployee);
mailAddress = t(mailAddress);
flgAdmin = t(flgAdmin);
flgRetirement = t(flgRetirement);
if (password == null)
password = "";
}
private static String t(String s) { return s == null ? "" : s.trim(); }
public Integer getIdEmployee() { return idEmployee; }
public void setIdEmployee(Integer v) { this.idEmployee = v; }
public String getNmEmployee() { return nmEmployee; }
public void setNmEmployee(String v) { this.nmEmployee = v; }
public String getKnEmployee() { return knEmployee; }
public void setKnEmployee(String v) { this.knEmployee = v; }
public String getMailAddress() { return mailAddress; }
public void setMailAddress(String v) { this.mailAddress = v; }
public String getPassword() { return password; }
public void setPassword(String v) { this.password = v; }
public String getFlgAdmin() { return flgAdmin; }
public void setFlgAdmin(String v) { this.flgAdmin = v; }
public String getFlgRetirement() { return flgRetirement; }
public void setFlgRetirement(String v) { this.flgRetirement = v; }
private static String t(String s) {
return s == null ? "" : s.trim();
}
public Integer getIdEmployee() {
return idEmployee;
}
public void setIdEmployee(Integer v) {
this.idEmployee = v;
}
public String getNmEmployee() {
return nmEmployee;
}
public void setNmEmployee(String v) {
this.nmEmployee = v;
}
public String getKnEmployee() {
return knEmployee;
}
public void setKnEmployee(String v) {
this.knEmployee = v;
}
public String getMailAddress() {
return mailAddress;
}
public void setMailAddress(String v) {
this.mailAddress = v;
}
public String getPassword() {
return password;
}
public void setPassword(String v) {
this.password = v;
}
public String getFlgAdmin() {
return flgAdmin;
}
public void setFlgAdmin(String v) {
this.flgAdmin = v;
}
public String getFlgRetirement() {
return flgRetirement;
}
public void setFlgRetirement(String v) {
this.flgRetirement = v;
}
}

View File

@@ -6,11 +6,11 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- 外部スクリプトの読み込み -->
<script th:src="@{/js/common.js}"></script>
<!-- <script th:src="@{/js/common.js}"></script>-->
<!-- CSSの読み込み -->
<link rel="stylesheet" th:href="@{/css/all.css}" type="text/css">
<link rel="stylesheet" th:href="@{/css/style.css}" type="text/css">
<!-- <link rel="stylesheet" th:href="@{/css/all.css}" type="text/css">-->
<!-- <link rel="stylesheet" th:href="@{/css/style.css}" type="text/css">-->
<title>ログイン</title>
</head>
@@ -19,20 +19,18 @@
<div class="loginContainer">
<h1>ログイン</h1>
<h1>書籍管理システム</h1>
<h2>ログイン</h2>
<form th:action="@{/doLogin}"
method="post"
th:object="${loginInfoForm}">
<!-- Validationエラーメッセージ -->
<!-- エラーメッセージ -->
<div class="msgBox error"
th:if="${#fields.hasErrors('*')}">
<p th:each="err : ${#fields.errors('*')}"
th:text="${err}">
</p>
th:if="${messageError != null}">
<span class="error"
th:text="${messageError.message}"></span>
</div>
<table>