From e90737e54fa1e1ffe34d0d79844973ef83208086 Mon Sep 17 00:00:00 2001 From: jabyte <32500012+jabyte@users.noreply.github.com> Date: Thu, 3 May 2018 13:45:14 +0100 Subject: [PATCH 01/29] Add files via upload --- .../WorkingWithArraysInThymeleafApplication.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/WorkingWithArraysInThymeleafApplication.java diff --git a/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/WorkingWithArraysInThymeleafApplication.java b/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/WorkingWithArraysInThymeleafApplication.java new file mode 100644 index 0000000000..d15e14ef35 --- /dev/null +++ b/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/WorkingWithArraysInThymeleafApplication.java @@ -0,0 +1,12 @@ +package com.baeldung.thymeleaf; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class WorkingWithArraysInThymeleafApplication { + + public static void main(String[] args) { + SpringApplication.run(WorkingWithArraysInThymeleafApplication.class, args); + } +} From 0c609288a60130c3896bacd9690bb497751cc148 Mon Sep 17 00:00:00 2001 From: jabyte <32500012+jabyte@users.noreply.github.com> Date: Thu, 3 May 2018 14:04:44 +0100 Subject: [PATCH 02/29] Delete WorkingWithArraysInThymeleafApplication.java --- .../WorkingWithArraysInThymeleafApplication.java | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/WorkingWithArraysInThymeleafApplication.java diff --git a/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/WorkingWithArraysInThymeleafApplication.java b/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/WorkingWithArraysInThymeleafApplication.java deleted file mode 100644 index d15e14ef35..0000000000 --- a/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/WorkingWithArraysInThymeleafApplication.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.baeldung.thymeleaf; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -@SpringBootApplication -public class WorkingWithArraysInThymeleafApplication { - - public static void main(String[] args) { - SpringApplication.run(WorkingWithArraysInThymeleafApplication.class, args); - } -} From 936dc5e346da30509dfede38e3f30ccc1a06bcfd Mon Sep 17 00:00:00 2001 From: jabyte <32500012+jabyte@users.noreply.github.com> Date: Thu, 10 May 2018 12:38:20 +0100 Subject: [PATCH 03/29] Add files via upload --- .../thymeleaf/controller/ArrayController.java | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/ArrayController.java diff --git a/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/ArrayController.java b/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/ArrayController.java new file mode 100644 index 0000000000..e36dcdf092 --- /dev/null +++ b/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/ArrayController.java @@ -0,0 +1,25 @@ +package com.baeldung.thymeleaf.controller; + +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; + +@Controller +public class ArrayController { + @GetMapping("/") + public String arrayController(Model model) { + String[] continents = new String[7]; + + continents[0] = "Africa"; + continents[1] = "Antarctica"; + continents[2] = "Assia"; + continents[3] = "Australia"; + continents[4] = "Europe"; + continents[5] = "North America"; + continents[6] = "Sourth America"; + + model.addAttribute("continents", continents); + + return "continents"; + } +} From 77227cdc9fb215c56404a210ae89976833a16ed5 Mon Sep 17 00:00:00 2001 From: jabyte <32500012+jabyte@users.noreply.github.com> Date: Thu, 10 May 2018 12:43:28 +0100 Subject: [PATCH 04/29] Create continents.html --- .../main/resources/templates/continents.html | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 spring-thymeleaf/src/main/resources/templates/continents.html diff --git a/spring-thymeleaf/src/main/resources/templates/continents.html b/spring-thymeleaf/src/main/resources/templates/continents.html new file mode 100644 index 0000000000..d170ccae23 --- /dev/null +++ b/spring-thymeleaf/src/main/resources/templates/continents.html @@ -0,0 +1,48 @@ + + +
++ We have a total of + continents in this world. Following is a list showing their order + based on the number of population in each of them. +
+ ++ The greatest + continents. +
+ ++ Europe is a continent: . +
+ ++ Array of continents is empty . +
+ + + Date: Thu, 10 May 2018 12:45:35 +0100 Subject: [PATCH 05/29] Add files via upload --- .../WorkingWithArraysInThymeleafApplication.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/WorkingWithArraysInThymeleafApplication.java diff --git a/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/WorkingWithArraysInThymeleafApplication.java b/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/WorkingWithArraysInThymeleafApplication.java new file mode 100644 index 0000000000..d15e14ef35 --- /dev/null +++ b/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/WorkingWithArraysInThymeleafApplication.java @@ -0,0 +1,12 @@ +package com.baeldung.thymeleaf; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class WorkingWithArraysInThymeleafApplication { + + public static void main(String[] args) { + SpringApplication.run(WorkingWithArraysInThymeleafApplication.class, args); + } +} From c3c8b73e2146de89f7f2002653a27e9368377c6c Mon Sep 17 00:00:00 2001 From: jabyte <32500012+jabyte@users.noreply.github.com> Date: Thu, 10 May 2018 12:51:25 +0100 Subject: [PATCH 06/29] Update pom.xml --- spring-thymeleaf/pom.xml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/spring-thymeleaf/pom.xml b/spring-thymeleaf/pom.xml index d13356b3d7..e74f7c2300 100644 --- a/spring-thymeleaf/pom.xml +++ b/spring-thymeleaf/pom.xml @@ -98,6 +98,13 @@- We have a total of - continents in this world. Following is a list showing their order - based on the number of population in each of them. -
+ ++ We have a total of + continents in this world. Following is a list showing their order + based on the number of population in each of them. +
-- The greatest - continents. -
++ The greatest + continents. +
-- Europe is a continent: . -
++ Europe is a continent: . +
-- Array of continents is empty . -
++ Array of continents is empty . +
- + Date: Thu, 10 May 2018 14:23:43 +0100 Subject: [PATCH 11/29] Delete ArrayController.java --- .../thymeleaf/controller/ArrayController.java | 25 ------------------- 1 file changed, 25 deletions(-) delete mode 100644 spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/ArrayController.java diff --git a/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/ArrayController.java b/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/ArrayController.java deleted file mode 100644 index e36dcdf092..0000000000 --- a/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/ArrayController.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.baeldung.thymeleaf.controller; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.GetMapping; - -@Controller -public class ArrayController { - @GetMapping("/") - public String arrayController(Model model) { - String[] continents = new String[7]; - - continents[0] = "Africa"; - continents[1] = "Antarctica"; - continents[2] = "Assia"; - continents[3] = "Australia"; - continents[4] = "Europe"; - continents[5] = "North America"; - continents[6] = "Sourth America"; - - model.addAttribute("continents", continents); - - return "continents"; - } -} From 5deaa416e61a58200f9e5780993cb848b5fe7321 Mon Sep 17 00:00:00 2001 From: jabyte <32500012+jabyte@users.noreply.github.com> Date: Thu, 10 May 2018 14:24:55 +0100 Subject: [PATCH 12/29] Add files via upload --- .../controller/ThymeleafArrayController.java | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/ThymeleafArrayController.java diff --git a/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/ThymeleafArrayController.java b/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/ThymeleafArrayController.java new file mode 100644 index 0000000000..789c87d870 --- /dev/null +++ b/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/ThymeleafArrayController.java @@ -0,0 +1,25 @@ +package com.baeldung.thymeleaf.controller; + +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; + +@Controller +public class ThymeleafArrayController { + @GetMapping("/") + public String arrayController(Model model) { + String[] continents = new String[7]; + + continents[0] = "Africa"; + continents[1] = "Antarctica"; + continents[2] = "Assia"; + continents[3] = "Australia"; + continents[4] = "Europe"; + continents[5] = "North America"; + continents[6] = "Sourth America"; + + model.addAttribute("continents", continents); + + return "continents"; + } +} From bc4594dacfa21ab99bc67fed2b80215e698cec1b Mon Sep 17 00:00:00 2001 From: jabyte <32500012+jabyte@users.noreply.github.com> Date: Thu, 10 May 2018 14:43:41 +0100 Subject: [PATCH 13/29] Update ThymeleafArrayController.java --- .../baeldung/thymeleaf/controller/ThymeleafArrayController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/ThymeleafArrayController.java b/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/ThymeleafArrayController.java index 789c87d870..5732827a3e 100644 --- a/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/ThymeleafArrayController.java +++ b/spring-thymeleaf/src/main/java/com/baeldung/thymeleaf/controller/ThymeleafArrayController.java @@ -6,7 +6,7 @@ import org.springframework.web.bind.annotation.GetMapping; @Controller public class ThymeleafArrayController { - @GetMapping("/") + @GetMapping("/arrays") public String arrayController(Model model) { String[] continents = new String[7]; From 8aad495404f8a65f7e98a8dcb2bbeb11248d8c64 Mon Sep 17 00:00:00 2001 From: jabyte <32500012+jabyte@users.noreply.github.com> Date: Thu, 10 May 2018 15:56:45 +0100 Subject: [PATCH 14/29] Update continents.html --- spring-thymeleaf/src/main/resources/templates/continents.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spring-thymeleaf/src/main/resources/templates/continents.html b/spring-thymeleaf/src/main/resources/templates/continents.html index 849f479413..0e7ffa3f58 100644 --- a/spring-thymeleaf/src/main/resources/templates/continents.html +++ b/spring-thymeleaf/src/main/resources/templates/continents.html @@ -5,6 +5,7 @@ +@@ -45,4 +46,4 @@
-