diff --git a/schleicherhof_pms/src/main/java/de/thd/pms/SchleicherhofPmsApplication.java b/schleicherhof_pms/src/main/java/de/thd/pms/SchleicherhofPmsApplication.java index 33f1202d525d72f75e503cb54f897637e39cccb2..5fbd06dbe1c0a02aa7980ba3f6b50c9c03f5d01d 100644 --- a/schleicherhof_pms/src/main/java/de/thd/pms/SchleicherhofPmsApplication.java +++ b/schleicherhof_pms/src/main/java/de/thd/pms/SchleicherhofPmsApplication.java @@ -2,11 +2,9 @@ package de.thd.pms; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.ComponentScan; - @SpringBootApplication -@ComponentScan({"com.mypackage.controller"}) + public class SchleicherhofPmsApplication { diff --git a/schleicherhof_pms/src/main/java/de/thd/pms/controller/HomeController.java b/schleicherhof_pms/src/main/java/de/thd/pms/controller/HomeController.java index ef4baa9487baf4894f87eacb30ec725c8fa9036e..cbdb2690ec5a11f25973253e84eb8ef8e5a5d642 100644 --- a/schleicherhof_pms/src/main/java/de/thd/pms/controller/HomeController.java +++ b/schleicherhof_pms/src/main/java/de/thd/pms/controller/HomeController.java @@ -1,25 +1,20 @@ + package de.thd.pms.controller; -//import org.apache.logging.log4j.LogManager; -//import org.apache.logging.log4j.Logger; -import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; -//import org.springframework.web.servlet.ModelAndView; +import org.springframework.web.bind.annotation.RestController; -@Controller -public class HomeController { - +@RestController +public class HomeController { @RequestMapping("/welcome") - - public String welcome() { - - return "hallo"; + public String home() { + return "Hallo Leute"; - + } } diff --git a/schleicherhof_pms/src/main/resources/application.properties b/schleicherhof_pms/src/main/resources/application.properties index dbb6b39e8927c6ff099624a9939c32661657dba0..6fc471fd219d29aa6682a9881ba8b4ace8e7e7b6 100644 --- a/schleicherhof_pms/src/main/resources/application.properties +++ b/schleicherhof_pms/src/main/resources/application.properties @@ -3,4 +3,4 @@ spring.datasource.url=jdbc:mysql://localhost:3306/schleicherhof_pms spring.datasource.username= spring.datasource.password= spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver -server.port=4321 +#server.port=4321 diff --git a/schleicherhof_pms/src/main/resources/templates/home.html b/schleicherhof_pms/src/main/resources/templates/home.html new file mode 100644 index 0000000000000000000000000000000000000000..c1e1dc2c750e48ef60e65d6adce5e059ac23f01b --- /dev/null +++ b/schleicherhof_pms/src/main/resources/templates/home.html @@ -0,0 +1,13 @@ +<!DOCTYPE html> +<html lang="de" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"> +<head th:include="head::head"></head> +<body> + <div class="container-fluid"> + <h1>Fahrtenbuch</h1> + </div> + <nav th:include="menu::menu"></nav> + <div class="container-fluid"><h2 th:text="${title}">Titel</h2></div> + <div class="container-fluid"><p th:text="${message}">Nachricht</p></div> + <div th:include="foot::foot"></div> +</body> +</html>