Workbook 2.3
Task 1
Add a speed
of 45
as a model attribute.
model.addAttribute("speed", 45);
The +
operator
You can add values using the
+
operator.
th:text="${modelAttribute} + ${modelAttribute}"
It will concatenate strings.
//hello //spring th:text="${modelAttribute} + ${modelAttribute}" >> Result: hello spring
It will add numbers.
//5 //5 th:text="${modelAttribute} + ${modelAttribute}" >> Result: 10
Use single quotes for plain text.
th:text="'plain text' + ${modelAttribute}"
Task 2
Inside sign.html
, create a header element that displays the speed:
Task 3
- Create an image element that displays
slow-down
only if the speed is higher than 60. - Use
th:if
orth:unless
. - Give the image a width of 200.
Task 4
- Create an image element that displays
speed-limit
if the speed is lower than 60. - Use
th:if
orth:unless
. - Give the image a width of 200.
Test case 1
Test case 2
Good Luck!
Feedback Summary
5.0
4 students
5
100%
4
0%
3
0%
2
0%
1
0%
Written Reviews
There are no written reviews yet.