Skip to content

Commit

Permalink
start to add persistence to the example
Browse files Browse the repository at this point in the history
  • Loading branch information
pmuir committed Mar 2, 2010
1 parent 719ed7f commit 53faf96
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
3 changes: 2 additions & 1 deletion jsf/login/src/main/webapp/home.xhtml
Expand Up @@ -12,11 +12,12 @@
<h:outputLabel for="username">Username:</h:outputLabel>
<h:inputText id="username" value="#{credentials.username}"/>
<h:outputLabel for="password">Password:</h:outputLabel>
<h:inputText id="password" value="#{credentials.password}"/>
<h:inputSecret id="password" value="#{credentials.password}"/>
</h:panelGrid>
<h:commandButton id="login" value="Login" action="#{login.login}" rendered="#{!login.loggedIn}"/>
<h:commandButton id="logout" value="Logout" action="#{login.logout}" rendered="#{login.loggedIn}"/>
</h:form>
<h:link outcome="/users.xhtml">View users</h:link>
</ui:define>
</ui:composition>
</html>
33 changes: 33 additions & 0 deletions jsf/login/src/main/webapp/users.xhtml
@@ -0,0 +1,33 @@
<!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:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">

<ui:composition template="template.xhtml">
<ui:define name="content">
<h:messages />
<h1>Users</h1>
<h:dataTable value="#{users}" var="u">
<h:column>
<f:facet name="header">
Username
</f:facet>
<h:outputText value="#{u.username}" />
</h:column>
<h:column>
<f:facet name="header">
Name
</f:facet>
<h:outputText value="#{u.name}" />
</h:column>
<h:column>
<f:facet name="header">
Password
</f:facet>
<h:outputText value="#{u.password}" />
</h:column>
</h:dataTable>
</ui:define>
</ui:composition>
</html>

0 comments on commit 53faf96

Please sign in to comment.