From 7558a8caf538bff56c4b25d268095b79a8807a40 Mon Sep 17 00:00:00 2001
From: Cristobal Bernal Mayordomo
<90463533+Racriberny@users.noreply.github.com>
Date: Thu, 15 Dec 2022 18:31:28 +0100
Subject: [PATCH] Pom cambiado...
---
pom.xml | 79 +++++++++++++++----
.../foro/controlador/controlador.java | 23 ++++++
src/main/resources/templates/index.html | 51 +++++++++++-
3 files changed, 137 insertions(+), 16 deletions(-)
create mode 100644 src/main/java/com/cristobalbernal/foro/controlador/controlador.java
diff --git a/pom.xml b/pom.xml
index 4d3d6f9..ed80db0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -15,25 +15,74 @@
Foro
17
+ 2021.0.5
-
- org.springframework.boot
- spring-boot-starter
-
-
-
- org.springframework.boot
- spring-boot-starter-data-jpa
-
+
+ org.springframework.boot
+ spring-boot-starter-thymeleaf
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+ 3.0.0
+
+
+ org.springframework.cloud
+ spring-cloud-starter
+ 3.1.5
+
+
+
+
+ org.webjars
+ bootstrap
+ 5.2.2
+
+
+
+ org.webjars.bower
+ jquery
+ 3.6.1
+
+
+
+ org.webjars
+ webjars-locator
+ 0.46
+
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
+
+
+ org.webjars
+ font-awesome
+ 6.2.0
+
-
+
+
+ org.springframework.boot
+ spring-boot-devtools
+ runtime
+ true
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
+
+
+
+ org.springframework.cloud
+ spring-cloud-dependencies
+ ${spring-cloud.version}
+ pom
+ import
+
+
+
diff --git a/src/main/java/com/cristobalbernal/foro/controlador/controlador.java b/src/main/java/com/cristobalbernal/foro/controlador/controlador.java
new file mode 100644
index 0000000..8afe1a4
--- /dev/null
+++ b/src/main/java/com/cristobalbernal/foro/controlador/controlador.java
@@ -0,0 +1,23 @@
+package com.cristobalbernal.foro.controlador;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+@Controller
+public class controlador {
+ @GetMapping({"/","","home","/inicio","/index"})
+ public String welcome(Model model) throws MalformedURLException {
+ final String currentURL = ServletUriComponentsBuilder.fromCurrentContextPath().build().toUriString();
+ URL requestURL = new URL(currentURL);
+ model.addAttribute("mensaje","Ramoncin");
+ String dominio = requestURL.getHost();
+ int x = dominio.indexOf(".");
+ String conDominio = dominio.substring(0,x);
+ model.addAttribute("dominio",conDominio);
+ return "index";
+ }
+}
diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html
index bd7bb64..9a4cf80 100644
--- a/src/main/resources/templates/index.html
+++ b/src/main/resources/templates/index.html
@@ -3,6 +3,48 @@
Foro
+
@@ -16,7 +58,14 @@
Submenu 1
Submenu 2
Submenu 3
- Submenu 4
+ Submenu 4
+
+