Browse Source

Pom cambiado...

master
Cristobal Bernal Mayordomo 2 years ago
parent
commit
7558a8caf5
3 changed files with 137 additions and 16 deletions
  1. +64
    -15
      pom.xml
  2. +23
    -0
      src/main/java/com/cristobalbernal/foro/controlador/controlador.java
  3. +50
    -1
      src/main/resources/templates/index.html

+ 64
- 15
pom.xml View File

@ -15,25 +15,74 @@
<description>Foro</description> <description>Foro</description>
<properties> <properties>
<java.version>17</java.version> <java.version>17</java.version>
<spring-cloud.version>2021.0.5</spring-cloud.version>
</properties> </properties>
<dependencies> <dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-data-jpa -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter</artifactId>
<version>3.1.5</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.webjars/bootstrap -->
<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
<version>5.2.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.webjars.bower/jquery -->
<dependency>
<groupId>org.webjars.bower</groupId>
<artifactId>jquery</artifactId>
<version>3.6.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.webjars/webjars-locator -->
<dependency>
<groupId>org.webjars</groupId>
<artifactId>webjars-locator</artifactId>
<version>0.46</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.webjars/font-awesome -->
<dependency>
<groupId>org.webjars</groupId>
<artifactId>font-awesome</artifactId>
<version>6.2.0</version>
</dependency>
</dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>${spring-cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build> <build>
<plugins> <plugins>


+ 23
- 0
src/main/java/com/cristobalbernal/foro/controlador/controlador.java View File

@ -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";
}
}

+ 50
- 1
src/main/resources/templates/index.html View File

@ -3,6 +3,48 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>Foro</title> <title>Foro</title>
<style type="text/css">
*{
padding: 0px;
margin: 0px;
}
#header{
margin: auto;
width: 500px;
font-family: Arial,Helvetica,sans-serif;
}
ul,ol{
list-style: none;
}
.nav li a{
background-color: #000;
color: #fff;
text-decoration: none;
padding: 10px 15px;
display: block;
}
.nav li a:hover{
background-color: rgba(67, 67, 67);
}
.nav > li{
float: left;
}
.nav li ul{
display:none;
position: absolute;
min-width: 140px;
}
.nav li:hover > ul{
display: block;
}
.nav li ul li{
position: relative;
}
.nav li ul li ul{
right: -140px;
top:0px
}
</style>
</head> </head>
<body> <body>
@ -16,7 +58,14 @@
<li><a href="">Submenu 1</a></li> <li><a href="">Submenu 1</a></li>
<li><a href="">Submenu 2</a></li> <li><a href="">Submenu 2</a></li>
<li><a href="">Submenu 3</a></li> <li><a href="">Submenu 3</a></li>
<li><a href="">Submenu 4</a></li>
<li><a href="">Submenu 4</a>
<ul>
<li><a href="">Submenu 1</a></li>
<li><a href="">Submenu 2</a></li>
<li><a href="">Submenu 3</a></li>
<li><a href="">Submenu 4</a></li>
</ul>
</li>
</ul> </ul>
</li> </li>


Loading…
Cancel
Save