/
index.xhtml
79 lines (77 loc) · 3.03 KB
/
index.xhtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
template="/WEB-INF/templates/default.xhtml">
<ui:define name="content">
<h1>Welcome to JBoss AS 7!</h1>
<p>You have successfully deployed a Java EE 6 web application
on JBoss AS 7.</p>
<h:form id="reg">
<h2>Register (Bean Validation example)</h2>
<p>Enforces annotation-based constraints defined on the
model class.</p>
<table>
<tr>
<th style="text-align: right;"><h:outputLabel
for="name" value="Name:" /></th>
<td><h:inputText id="name" value="#{newMember.name}" />
<h:message for="name" errorClass="invalid" /></td>
</tr>
<tr>
<th style="text-align: right;"><h:outputLabel
for="email" value="Email:" /></th>
<td><h:inputText id="email"
value="#{newMember.email}" /> <h:message
for="email" errorClass="invalid" /></td>
</tr>
<tr>
<th style="text-align: right;"><h:outputLabel
for="phoneNumber" value="Phone #:" /></th>
<td><h:inputText id="phoneNumber"
value="#{newMember.phoneNumber}" /> <h:message
for="phoneNumber" errorClass="invalid" /></td>
</tr>
</table>
<p>
<h:commandButton id="register"
action="#{memberRegistration.register}" value="Register" />
<h:outputText value=" Registered!"
rendered="#{facesContext.postback and empty facesContext.messageList}"
style="color: green;" />
</p>
</h:form>
<h2>Members</h2>
<h:panelGroup rendered="#{empty members}">
<em>No registered members.</em>
</h:panelGroup>
<h:dataTable var="_member" value="#{members}"
rendered="#{not empty members}">
<h:column>
<f:facet name="header">Id</f:facet>
#{_member.id}
</h:column>
<h:column>
<f:facet name="header">Name</f:facet>
#{_member.name}
</h:column>
<h:column>
<f:facet name="header">Email</f:facet>
#{_member.email}
</h:column>
<h:column>
<f:facet name="header">Phone #</f:facet>
#{_member.phoneNumber}
</h:column>
<h:column>
<f:facet name="header">REST URL</f:facet>
<a href="#{request.contextPath}/rest/members/#{_member.id}">/rest/members/#{_member.id}</a>
</h:column>
<f:facet name="footer">
REST URL for all members: <a
href="#{request.contextPath}/rest/members">/rest/members</a>
</f:facet>
</h:dataTable>
</ui:define>
</ui:composition>