JSF datatable example
|
|
|
In this example, we’re going to use the JSF h:datatable tag and system properties to display a simple table. I will show you how to define a simple data model returned with a backing bean.
Definition of the backing bean data provider
We have an Application backing bean called applicationBB thanks to the default name derived from the managed bean annotation . The backing bean has a bean property called systemProperties returning the a sorted list of SystemProperty object.
Displaying the data in a datatable
Datatable display
As a conclusionof the short tutorial the resulting page should look like the table below :
System
| Key | value |
|---|---|
| awt.nativeDoubleBuffering | true |
| awt.toolkit | apple.awt.CToolkit |
| catalina.base | /Applications/Tomcat-7.0.12 |
| catalina.home | /Applications/Tomcat-7.0.12 |
| catalina.useNaming | true |
| common.loader | ${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar |
| file.encoding | MacRoman |
| file.encoding.pkg | sun.io |
| file.separator | / |
| ftp.nonProxyHosts | local|*.local|169.254/16|*.169.254/16 |
| gopherProxySet | false |
| http.nonProxyHosts | local|*.local|169.254/16|*.169.254/16 |
| java.awt.graphicsenv | apple.awt.CGraphicsEnvironment |
| java.awt.printerjob | apple.awt.CPrinterJob |
| java.class.path | /Applications/Tomcat-7.0.12/bin/bootstrap.jar:/Applications/Tomcat-7.0.12/bin/tomcat-juli.jar |
| java.class.version | 50.0 |
| java.endorsed.dirs | /Applications/Tomcat-7.0.12/endorsed |
| java.ext.dirs | /Library/Java/Extensions:/System/Library/Java/Extensions:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext |
| java.home | /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home |
etc....
Tags: http , bean , public , xmlns , system , facet , value= , name= , data , datatable , backing , column , define