|
Example of JSF Components in a JSP Page
Listing 1. <HTML>
<HEAD> <title>Hello</title> </HEAD>
<%@ taglib uri=http://java.sun.com/jsf/html prefix="h" %>
<%@ taglib uri=http://java.sun.com/jsf/core prefix="f" %>
<body bgcolor="white">
<f:view>
<h:form id="helloForm" >
<h2>Hi. My name is Duke. I'm thinking of a number from
<h:outputText value="#{UserNumberBean.minimum}"/> to
<h:outputText value="#{UserNumberBean.maximum}"/>.
Can you guess it?</h2>
<h:graphicImage id="waveImg" url="/wave.med.gif" />
<h:inputText id="userNo"
value="#{UserNumberBean.userNumber}">
<f:validateLongRange minimum="#{UserNumberBean.minimum}" maximum="#{UserNumberBean.maximum}" />
</h:inputText>
<h:commandButton id="submit" action="success"
value="Submit" /> <p>
<h:message style="color: red;
font-family: 'New Century Schoolbook', serif;
font-style: oblique;
text-decoration: overline"
id="errors1"
for="userNo"/>
</h:form>
</f:view>
</HTML>
|