-
Notifications
You must be signed in to change notification settings - Fork 0
/
hello.xhtml
35 lines (34 loc) · 1.13 KB
/
hello.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
<!DOCTYPE html>
<html lang="en"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:h="http://xmlns.jcp.org/jsf/html">
<f:view>
<h:head>
<title>Hello, World!</title>
</h:head>
<h:body>
<h:form>
<h:outputLabel for="name" value="Enter your name" required="true"/>
<h:inputText id="name" value="#{hello2.name}">
<f:validateLength minimum="2" maximum="5" />
</h:inputText>
<h:message for="name" style="color:red" />
<br/>
<h:inputText id="email" value="#{hello2.email}">
<f:validator validatorId="emailValidator"/>
</h:inputText>
<h:message for="email" style="color:red" />
<br/>
<h:commandButton value="Say hello" action="#{hello2.createMessage}">
<f:ajax execute="@form" render="@form"/>
</h:commandButton>
<br/>
<!-- <h:messages style="color:red" />-->
#{hello2.message}
<br/>
#{hello2.email}
</h:form>
</h:body>
</f:view>
</html>