Skip to content

Commit d5e146c

Browse files
committed
thymeleaf forms clean up
1 parent 04c6a2d commit d5e146c

File tree

7 files changed

+11
-31
lines changed

7 files changed

+11
-31
lines changed

14-spring-boot-thymeleaf/bonus-code-spring-security-user-registration-custom-user-details-thymeleaf-spring-boot/src/main/resources/templates/fancy-login.html

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<div style="padding-top: 30px" class="panel-body">
3232

3333
<!-- Login Form -->
34-
<form action="#" th:action="@{/authenticateTheUser}"
34+
<form th:action="@{/authenticateTheUser}"
3535
method="POST" class="form-horizontal">
3636

3737
<!-- Place for messages: error, alert etc ... -->
@@ -73,12 +73,6 @@
7373
<button type="submit" class="btn btn-success">Login</button>
7474
</div>
7575
</div>
76-
77-
<!-- I'm manually adding tokens ... Bro! -->
78-
79-
<input type="hidden"
80-
th:name="${_csrf.parameterName}"
81-
th:value="${_csrf.token}" />
8276

8377
</form>
8478

14-spring-boot-thymeleaf/bonus-thymeleafdemo-employees-security-with-in-memory-authentication/src/main/resources/templates/employees/employee-form.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ <h3>Employee Directory</h3>
2121

2222
<p class="h4 mb-4">Save Employee</p>
2323

24-
<form action="#" th:action="@{/employees/save}"
25-
th:object="${employee}" method="POST">
24+
<form th:action="@{/employees/save}"
25+
th:object="${employee}" method="POST">
2626

2727
<!-- Add hidden form field to handle update -->
2828
<input type="hidden" th:field="*{id}" />

14-spring-boot-thymeleaf/bonus-thymeleafdemo-employees-security-with-in-memory-authentication/src/main/resources/templates/employees/list-employees.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ <h3>Employee Directory</h3>
2828
<br><br>
2929
</div>
3030

31-
<form action="#" th:action="@{/employees/search}" class="form-inline">
31+
<form th:action="@{/employees/search}" class="form-inline">
3232
<a th:href="@{/employees/showFormForAdd}"
3333
class="btn btn-primary btn-sm mr-5 mb-3">
3434
Add Employee

14-spring-boot-thymeleaf/bonus-thymeleafdemo-employees-security-with-in-memory-authentication/src/main/resources/templates/fancy-login.html

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<div style="padding-top: 30px" class="panel-body">
3434

3535
<!-- Login Form -->
36-
<form action="#" th:action="@{/authenticateTheUser}"
36+
<form th:action="@{/authenticateTheUser}"
3737
method="POST" class="form-horizontal">
3838

3939
<!-- Place for messages: error, alert etc ... -->
@@ -85,12 +85,6 @@
8585
<button type="submit" class="btn btn-success">Login</button>
8686
</div>
8787
</div>
88-
89-
<!-- I'm manually adding tokens ... Bro! -->
90-
91-
<input type="hidden"
92-
name="${_csrf.parameterName}"
93-
value="${_csrf.token}" />
9488

9589
</form>
9690

14-spring-boot-thymeleaf/bonus-thymeleafdemo-employees-security-with-jdbc-authentication/src/main/resources/templates/employees/employee-form.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ <h3>Employee Directory</h3>
2121

2222
<p class="h4 mb-4">Save Employee</p>
2323

24-
<form action="#" th:action="@{/employees/save}"
25-
th:object="${employee}" method="POST">
24+
<form th:action="@{/employees/save}"
25+
th:object="${employee}" method="POST">
2626

2727
<!-- Add hidden form field to handle update -->
2828
<input type="hidden" th:field="*{id}" />

14-spring-boot-thymeleaf/bonus-thymeleafdemo-employees-security-with-jdbc-authentication/src/main/resources/templates/employees/list-employees.html

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
1010

1111
<!-- Bootstrap CSS -->
12-
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
12+
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
1313

1414
<title>Employee Directory</title>
1515
</head>
@@ -28,7 +28,7 @@ <h3>Employee Directory</h3>
2828
<br><br>
2929
</div>
3030

31-
<form action="#" th:action="@{/employees/search}" class="form-inline">
31+
<form th:action="@{/employees/search}" class="form-inline">
3232
<a th:href="@{/employees/showFormForAdd}"
3333
class="btn btn-primary btn-sm mr-5 mb-3">
3434
Add Employee
@@ -58,7 +58,6 @@ <h3>Employee Directory</h3>
5858
<td th:text="${tempEmployee.email}" />
5959

6060
<td>
61-
6261
<div sec:authorize="hasAnyRole('ROLE_MANAGER', 'ROLE_ADMIN')">
6362

6463
<!-- Add "update" button/link -->
@@ -78,8 +77,7 @@ <h3>Employee Directory</h3>
7877
Delete
7978
</a>
8079

81-
</div>
82-
80+
</div>
8381
</td>
8482

8583

14-spring-boot-thymeleaf/bonus-thymeleafdemo-employees-security-with-jdbc-authentication/src/main/resources/templates/fancy-login.html

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<div style="padding-top: 30px" class="panel-body">
3434

3535
<!-- Login Form -->
36-
<form action="#" th:action="@{/authenticateTheUser}"
36+
<form th:action="@{/authenticateTheUser}"
3737
method="POST" class="form-horizontal">
3838

3939
<!-- Place for messages: error, alert etc ... -->
@@ -85,12 +85,6 @@
8585
<button type="submit" class="btn btn-success">Login</button>
8686
</div>
8787
</div>
88-
89-
<!-- I'm manually adding tokens ... Bro! -->
90-
91-
<input type="hidden"
92-
name="${_csrf.parameterName}"
93-
value="${_csrf.token}" />
9488

9589
</form>
9690

0 commit comments

Comments
 (0)