Skip to content

Commit 9988a78

Browse files
committedJul 29, 2024
Polishing.
Consistently use array access syntax in template. Use page offset to calculate numbering. Use latest MongoDB Docker image.
1 parent 3743072 commit 9988a78

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed
 

‎web/querydsl/src/main/resources/templates/index.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ <h3 class="panel-title">Search</h3>
2323

2424
<div class="form-group col-sm-6">
2525
<label for="firstname" class="control-label">Firstname:</label>
26-
<input id="firstname" name="firstname" th:value="${param.firstname}" type="text" class="form-control" autofocus="autofocus" />
26+
<input id="firstname" name="firstname" th:value="${param['firstname']}" type="text" class="form-control" autofocus="autofocus" />
2727
</div>
2828
<div class="form-group col-sm-6">
2929
<label for="lastname" class="control-label">Lastname:</label>
30-
<input id="lastname" name="lastname" th:value="${param.lastname}" type="text" class="form-control" autofocus="autofocus" />
30+
<input id="lastname" name="lastname" th:value="${param['lastname']}" type="text" class="form-control" autofocus="autofocus" />
3131
</div>
3232
<div class="form-group col-sm-6">
3333
<label for="address.city" class="control-label">City:</label>
@@ -42,7 +42,7 @@ <h3 class="panel-title">Search</h3>
4242
</div>
4343
<div class="form-group col-sm-6">
4444
<label for="nationality" class="control-label">Nationality:</label>
45-
<input id="nationality" name="nationality" th:value="${param.nationality}" type="text"
45+
<input id="nationality" name="nationality" th:value="${param['nationality']}" type="text"
4646
class="form-control" />
4747
</div>
4848
<div class="form-group col-sm-12">
@@ -73,11 +73,11 @@ <h3 class="panel-title">Search</h3>
7373
<th>City</th>
7474
<th>Street</th>
7575
<th>Email</th>
76-
</tr>
76+
</tr>
7777
</thead>
7878
<tbody>
7979
<tr th:each="user : ${users}">
80-
<td th:text="${users.number * users.size + userStat.index + 1} + '.'">1.</td>
80+
<td th:text="${users.pageable.offset + userStat.index + 1} + '.'">1.</td>
8181
<td class="text-center">
8282
<img th:src="${user.picture.small}" class="rounded-circle" />
8383
</td>

‎web/querydsl/src/test/java/example/users/TestApplication.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@
1919

2020
/**
2121
* @author Tim Sparg
22+
* @author Oliver Drotbohm
2223
*/
2324
public class TestApplication {
2425

2526
public static void main(String[] args) {
26-
SpringApplication.from(Application::main).with(TestcontainersConfiguration.class).run(args);
27+
SpringApplication.from(Application::main)
28+
.with(TestcontainersConfiguration.class)
29+
.run(args);
2730
}
28-
2931
}

‎web/querydsl/src/test/java/example/users/TestcontainersConfiguration.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
/**
2626
* @author Tim Sparg
27+
* @author Oliver Drotbohm
2728
*/
2829
@TestConfiguration(proxyBeanMethods = false)
2930
public class TestcontainersConfiguration {
@@ -32,7 +33,6 @@ public class TestcontainersConfiguration {
3233
@ServiceConnection
3334
@RestartScope
3435
MongoDBContainer mongoDbContainer() {
35-
return new MongoDBContainer(DockerImageName.parse("mongo:7"));
36+
return new MongoDBContainer(DockerImageName.parse("mongo:latest"));
3637
}
37-
3838
}

0 commit comments

Comments
 (0)
Please sign in to comment.