Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Manuel Ruiz Fernández
/
freemarker
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Merge Requests
0
Pipelines
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d3839926
authored
May 04, 2023
by
mrf00020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Añadir pruebas
parent
5a3b8da6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
85 additions
and
30 deletions
src/main/java/com/example/FreeMarket/controller/SalasController.java
src/main/resources/templates/home.ftl
src/main/resources/templates/index.ftl
src/main/resources/templates/pruebas.ftl
src/main/java/com/example/FreeMarket/controller/SalasController.java
View file @
d3839926
...
...
@@ -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
(){
...
...
src/main/resources/templates/home.ftl
deleted
100644 → 0
View file @
5a3b8da6
<!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
src/main/resources/templates/index.ftl
View file @
d3839926
...
...
@@ -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>
...
...
src/main/resources/templates/pruebas.ftl
0 → 100644
View file @
d3839926
<!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>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment