Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bspastoriza19-esi-solutions
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Breixo Senra Pastoriza
bspastoriza19-esi-solutions
Commits
2ff87020
Commit
2ff87020
authored
Oct 26, 2025
by
Breixo Senra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Menu.xhtml añadido
parent
5ff6ed34
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
0 deletions
+43
-0
LoginManagedBean.java
...src/main/java/es/uvigo/esei/xcs/jsf/LoginManagedBean.java
+10
-0
menu.xhtml
jsf/src/main/webapp/vet/menu.xhtml
+33
-0
No files found.
jsf/src/main/java/es/uvigo/esei/xcs/jsf/LoginManagedBean.java
View file @
2ff87020
...
...
@@ -52,6 +52,8 @@ public class LoginManagedBean {
return
redirectTo
(
this
.
getAdminViewId
());
}
else
if
(
this
.
isOwner
())
{
return
redirectTo
(
this
.
getOwnerViewId
());
}
else
if
(
this
.
isVet
())
{
return
redirectTo
(
this
.
getVetViewId
());
}
else
{
return
redirectTo
(
this
.
getViewId
());
}
...
...
@@ -88,6 +90,10 @@ public class LoginManagedBean {
return
"/admin/owners.xhtml"
;
}
private
String
getVetViewId
()
{
return
"/vet/menu.xhtml"
;
}
private
boolean
isAdmin
()
{
return
this
.
isUserInRole
(
"ADMIN"
);
}
...
...
@@ -96,6 +102,10 @@ public class LoginManagedBean {
return
this
.
isUserInRole
(
"OWNER"
);
}
private
boolean
isVet
()
{
return
this
.
isUserInRole
(
"VET"
);
}
private
boolean
isUserInRole
(
String
role
)
{
return
FacesContext
.
getCurrentInstance
().
getExternalContext
()
.
isUserInRole
(
role
);
...
...
jsf/src/main/webapp/vet/menu.xhtml
0 → 100644
View file @
2ff87020
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html
xmlns=
"http://www.w3.org/1999/xhtml"
xmlns:h=
"http://xmlns.jcp.org/jsf/html"
xmlns:p=
"http://primefaces.org/ui"
xmlns:ui=
"http://xmlns.jcp.org/jsf/facelets"
xmlns:a=
"http://xmlns.jcp.org/jsf/passthrough"
>
<head>
<title>
Vet Menu
</title>
</head>
<body>
<ui:composition
template=
"../WEB-INF/template.xhtml"
>
<ui:define
name=
"jumbotron"
>
<h2>
Menu
</h2>
<div>
Bienvenido al menú de gestión de veterinarios:
</div>
</ui:define>
<ui:define
name=
"content"
>
<h:form>
<p:menu>
<p:menuitem
value=
"Gestión Vacunas"
url=
"#{request.contextPath}/vet/vaccines.xhtml"
/>
<p:menuitem
value=
"Asignación de Mascotas"
url=
"#{request.contextPath}/vet/pets.xhtml"
/>
<p:menuitem
value=
"Listado de Vacunas Asignadas"
url=
"#{request.contextPath}/vet/supervisedPets.xhtml"
/>
</p:menu>
</h:form>
</ui:define>
</ui:composition>
</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