From 6f6f705495eef90e25b1b1d894144df11e068156 Mon Sep 17 00:00:00 2001 From: Seil0 Date: Mon, 25 Nov 2019 16:15:36 +0100 Subject: [PATCH] updated spring boot to 2.2.1 * added a header as fragment --- prototype/build.gradle | 2 +- .../hso/ecommerce/app/GreetingController.java | 6 ++++++ .../src/main/resources/application.properties | 15 +++++++++++++++ .../resources/templates/fragments/header.html | 17 +++++++++++++++++ .../src/main/resources/templates/home.html | 11 +++++++++++ 5 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 prototype/src/main/resources/application.properties create mode 100644 prototype/src/main/resources/templates/fragments/header.html create mode 100644 prototype/src/main/resources/templates/home.html diff --git a/prototype/build.gradle b/prototype/build.gradle index 923cc4f..a8cdb7e 100644 --- a/prototype/build.gradle +++ b/prototype/build.gradle @@ -3,7 +3,7 @@ buildscript { mavenCentral() } dependencies { - classpath("org.springframework.boot:spring-boot-gradle-plugin:2.1.10.RELEASE") + classpath("org.springframework.boot:spring-boot-gradle-plugin:2.2.1.RELEASE") } } diff --git a/prototype/src/main/java/org/hso/ecommerce/app/GreetingController.java b/prototype/src/main/java/org/hso/ecommerce/app/GreetingController.java index b23dd3b..3f3b79c 100644 --- a/prototype/src/main/java/org/hso/ecommerce/app/GreetingController.java +++ b/prototype/src/main/java/org/hso/ecommerce/app/GreetingController.java @@ -14,4 +14,10 @@ public class GreetingController { return "greeting"; } + @GetMapping("/home") + public String home(Model model) { + //model.addAttribute("name", name); + return "home"; + } + } diff --git a/prototype/src/main/resources/application.properties b/prototype/src/main/resources/application.properties new file mode 100644 index 0000000..8cff660 --- /dev/null +++ b/prototype/src/main/resources/application.properties @@ -0,0 +1,15 @@ +# ---------------------------------------- +# CORE PROPERTIES +# ---------------------------------------- + +# LOGGING + +logging.level.org.springframework.web=INFO + +# ---------------------------------------- +# WEB PROPERTIES +# ---------------------------------------- + +# EMBEDDED SERVER CONFIGURATION (ServerProperties) +server.address=127.0.0.1 +server.port=8080 \ No newline at end of file diff --git a/prototype/src/main/resources/templates/fragments/header.html b/prototype/src/main/resources/templates/fragments/header.html new file mode 100644 index 0000000..91b8f72 --- /dev/null +++ b/prototype/src/main/resources/templates/fragments/header.html @@ -0,0 +1,17 @@ + + + + + + + + + + diff --git a/prototype/src/main/resources/templates/home.html b/prototype/src/main/resources/templates/home.html new file mode 100644 index 0000000..e524b9a --- /dev/null +++ b/prototype/src/main/resources/templates/home.html @@ -0,0 +1,11 @@ + + + + + e-commerce + + + +
Header
+ +