Commit d3839926 by mrf00020

Añadir pruebas

parent 5a3b8da6
......@@ -24,13 +24,15 @@ public class SalasController {
return "index";
}
/*@GetMapping("/")
public ModelAndView home() {
ModelAndView mv = new ModelAndView("home");
@GetMapping("/pruebas")
public ModelAndView pruebas() {
List<Sala> salas = salaRepository.findAll();
mv.addObject("salas", salas);
return mv;
}*/
Map< String, Object > params = new HashMap< String, Object>();
params.put("salas", salas);
return new ModelAndView("pruebas", params);
}
@GetMapping("/showSalas")
public ModelAndView showCities(){
......
<!DOCTYPE html>
<html>
<head>
<title>Home page</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
rel="stylesheet" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T"
crossorigin="anonymous">
</head>
<body>
<#list salas as sala>
<tr>
<td>${sala.id}</td>
<td>${sala.descripcion}</td>
<td>${sala.ubicacion}</td>
<td>${sala.tamano}</td>
</tr>
</#list>
</body>
</html>
\ No newline at end of file
......@@ -18,6 +18,8 @@
<a href="showSalas">Ver Salas (Recuperar datos de salas de la base de datos.)</a>
<br/>
<a href="home">home </a>
<br/>
<a href="pruebas">Pruebas </a>
</div>
</div>
</body>
......
<!DOCTYPE html>
<html>
<head>
<title>Pruebas</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
rel="stylesheet" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T"
crossorigin="anonymous">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="container">
<div class="panel panel-primary">
<div class="panel-heading">
<h2>Lista de salas</h2>
</div>
<div class="panel-body">
<table class="table table-striped">
<thead>
<tr>
<th>ID</th>
<th>Descripion</th>
<th>Ubicacion</th>
<th>Tamaño</th>
</tr>
</thead>
<tbody>
<#list salas as sala>
<tr>
<td>${sala.id}</td>
<td>${sala.descripcion}</td>
<td>${sala.ubicacion}</td>
<td>${sala.tamano}</td>
</tr>
</#list>
</tbody>
</table>
</div>
</div>
</div>
<br/>
<div class="container">
<div class="panel panel-primary">
<div class="panel-heading">
<h2>Lista de salas con id par</h2>
</div>
<div class="panel-body">
<table class="table table-striped">
<thead>
<tr>
<th>ID</th>
<th>Descripion</th>
<th>Ubicacion</th>
<th>Tamaño</th>
</tr>
</thead>
<tbody>
<#list salas as sala>
<#if >
<tr>
<td>${sala.id}</td>
<td>${sala.descripcion}</td>
<td>${sala.ubicacion}</td>
<td>${sala.tamano}</td>
</tr>
</#if>
</#list>
</tbody>
</table>
</div>
</div>
</div>
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment