X

Geertjan's Blog

  • October 26, 2013

Simple HTML5 Friendly Markup Sample

Geertjan Wielenga
Product Manager

From a demo done by David Heffelfinger (who has a great Java EE 7 screencast series here), on HTML5 friendly markup.

index.xhtml: 

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:jsf="http://xmlns.jcp.org/jsf">
<title>Data Entry Page</title>
<body>
<form method="POST" jsf:id='form'>
<table>
<tr>
<td>Name:</td>
<td><input jsf:id='name' type="text" jsf:value="${person.name}" /></td>
</tr>
<tr>
<td>City</td>
<th><input jsf:id='city' type="text" jsf:value="${person.city}"/></th>
</tr>
<tr>
<td><input type="submit" value="Submit" jsf:action="confirmation" /></td>
</tr>
</table>
</form>
</body>
</html>

confirmation.xhtml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Data Confirmation Page</title>
</head>
<body>
<h1>#{person.name}</h1> from <h2>#{person.city}</h2>
</body>
</html>

Person.java:

package org.demo;
import javax.enterprise.inject.Model;
@Model
public class Person {
String name;
String city;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
}

Related info:

http://jsflive.wordpress.com/2013/08/08/jsf22-html5/

http://hantsy.blogspot.nl/2013/08/jsf-22-html5-support.html

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha
Oracle

Integrated Cloud Applications & Platform Services