Pagina welcome.xhtml
Last updated
Was this helpful?
Last updated
Was this helpful?
Es la pagina de Bienvenida para el usuario logeado.
Se incluye en <meta> refresh que verifica el tiempo de expiracion de la sesion
<meta http-equiv="refresh" content="#{facesContext.externalContext.sessionMaxInactiveInterval};url=#{request.contextPath}/faces/viewExpiredException.xhtml"/>
Codigo:
<?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:f="http://xmlns.jcp.org/jsf/core"
xmlns:p="http://primefaces.org/ui">
<h:head>
<title>Facelet Title</title>
<meta http-equiv="refresh" content="#{facesContext.externalContext.sessionMaxInactiveInterval};url=#{request.contextPath}/faces/viewExpiredException.xhtml"/>
</h:head>
<h:body>
<f:view>
<h:form id="form" rendered="#{loginController.loggedIn}">
<p:messages autoUpdate="true" id="growl"/>
<p:panel header="Bienvenido">
<p:panelGrid columns="2">
Welcome #{loginController.username}
<p:commandButton value="Saludo" action="#{loginController.saludar}" update=":form:growl"/>
<f:facet name="footer">
<p:commandButton value="Salir de la sesion" action="#{loginController.doLogout()}"/>
</f:facet>
</p:panelGrid>
</p:panel>
</h:form>
<h:form id="form2" rendered="#{!loginController.loggedIn}">
<p:panel header="Usuario no logeado">
<p:link value="Home" outcome="index"/>
</p:panel>
</h:form>
</f:view>
</h:body>
</html>