View RSS Feed

My Java Tips

Sample JSF page

Rate this Entry
by , 11-02-2011 at 07:17 PM (1700 Views)
Creating JSF page is simple and easy. There are few things to remember which I will list down.

The page must include JSF tag library and HTML and core tags.

All the JSF tags must enclosed between a set of view tag.
Use JSF form and form component tags.
Use h:input_text and not input type=text
Use h:command_button and not input type=submit

A page may include validators and event listeners on any form components

For example:

<f:form formname="logonForm">
<h:panel_grid columns="2">
<h:output_text value="Username:/">
<h:input_text id="username" length="16" valueref="logonBean.username/">
<h:output_text value="Password:/">
<h:input_secret id="password" length="16" valueref="logonBean.password/">
<h:command_button type="submit" actionref="logonBean.logon/">
<h:command_button type="reset" label="Reset/">

Submit "Sample JSF page" to Facebook Submit "Sample JSF page" to Digg Submit "Sample JSF page" to Submit "Sample JSF page" to StumbleUpon Submit "Sample JSF page" to Google

Updated 11-02-2011 at 07:19 PM by Java Tip

Tags: None Add / Edit Tags