Friday, August 22, 2008

JSF inputSecret Tag

All attributes of the inputSecret tag are explained as follows:

  • accesskey: This is standard html attribute. It is used to set the access key for the element which is used to send the focus to the element when pressed.

  • alt: This is used as an alternate text that is displayed when browser is not able to display the element.

  • binding: It takes the value binding expression that is used to link the component to the property of the backing bean.

  • converter: This specifies the converter for the component. This can be static value or EL expression.

  • dir: It is used to set the direction of the text to be displayed. It can take two values LTR(left to right) and RTL (right to left).

  • disabled: Its a boolean attribute. This is used to disable the element to receive focus, when it is set to true.

  • id: This attribute is used to uniquely identify the element within the closest container.

  • immediate: Its a boolean attribute. It is used to identify during which phase value change event should occur. If this attribute is set to true then in place of firing the event during the process validation phase, these event are sent immadiately at the end of apply request values phase.

  • lang: It is used to set the base language of the component when displayed.

  • maxlength: It is used to set the maximum length of character that can be input into the text field.

  • onblur: It is used to set the java script code to execute when focus is lost from the element.

  • onchange: It is used to set the java script code to execute when element is modified.

  • onclick: Script to be invoked when the element is clicked.

  • ondblclick: It is used for Java Script code to be invoked when the element is double-clicked.

  • onfocus: It is used to set the java script code to execute when element receives the focus.

  • onkeydown: It is used for Java Script code to be invoked when a key is pressed down over this element.

  • onkeypress: It is used for Java Script code to be invoked when a key is pressed over this element.

  • onkeyup: It is used for Java Script code to be invoked when a key is released over this element.

  • onmousedown: It is used for Java Script code to be invoked when the pointing device is pressed over this element.

  • onmousemove: It is used for Java Script code to be invoked when the pointing device is moved while it is in this element.

  • onmouseout: It is used for Java Script code to be invoked when the pointing device is moves out of this element.

  • onmouseover: It is used for Java Script code to be invoked when the pointing device is moved into this element.

  • onmouseup: It is used for Java Script code to be invoked when the pointing device is released over this element.

  • onselect: It is used to set the java script code to execute when text of the component is selected by the user.

  • readonly: Its a boolean attribute. It is used to indicate the user that its value can't be modified, if it is set to true.

  • redisplay: This is a boolean attribute. This is used to specify that the password, that have been entered previously, has to be rendered again or not. Its default value is "false" because we generally need not to do this for security reasons.

  • rendered: Its a boolean attribute. Its default value is true. It determines whether this component should be rendered or not.

  • required: Its a boolean attribute. It indicates that its value is required by the user before the submission of the form to the server. If it is set to true and value is not provided then an error message comes.

  • size: It is used to set the width (in character) of the component.

  • style: It is used to set the CSS style definition for the component.

  • styleClass: It is used to set the CSS class for the component.

  • tabindex: This is a standard html attribute. It is used to set the order of receiving the focus on the movement of TAB key by the user.

  • title: It is the standard html attribute. It is used to set the tooltip text for this component.

  • validator: It takes the method binding expression. This expression represents the validator method. This method is called at the time of validation of the component.

  • value: This is to set the current value of the component.

  • valueChangeListener: This also takes a method binding expression. This expression represents value change listener method. This method will be called when new value is set for this component.

source: roseindia.net

Thursday, August 21, 2008

SF formTag

This tag contains some attributes that are discussed below :

  • id : This attribute is used to uniquely identify the element within the closest container.
  • rendered : Its a boolean attribute. Its default value is true. It determines whether this component should be rendered or not.
  • binding : It takes the value binding expression that is used to link the component to the property of the backing bean.
  • dir : It is used to set the direction of the text to be displayed. It can take two values LTR(left to right) and RTL (right to left).
  • lang : It is used to set the base language of the component when displayed.
  • style : It is used to set the CSS style definition for the component.
  • title : It is the standard html attribute. It is used to set the tooltip text for this component.
  • styleClass : It is used to set the CSS class for the component.
  • target : This is used to identify the name of the frame where the response generated by the server is displayed when we submit the form.
  • accept : Its a comma separated list of content types that is handled by the server which processes this form.
  • acceptcharset : It is used to list character encoding used for the data input by the user and that will be accepted by the user.
  • enctype : This is used to set the content type of the data that will be submitted to the server.
  • onclick : Script to be invoked when the element is clicked.
  • ondblclick : It is used for Java Script code to be invoked when the element is double-clicked.
  • onmousedown : It is used for Java Script code to be invoked when the pointing device is pressed over this element.
  • onmouseup : It is used for Java Script code to be invoked when the pointing device is released over this element.
  • onmouseover : It is used for Java Script code to be invoked when the pointing device is moved into this element.
  • onmousemove : It is used for Java Script code to be invoked when the pointing device is moved while it is in this element.
  • onmouseout : It is used for Java Script code to be invoked when the pointing device is moves out of this element.
  • onkeypress : It is used for Java Script code to be invoked when a key is pressed over this element.
  • onkeydown : It is used for Java Script code to be invoked when a key is pressed down over this element.
  • onkeyup : It is used for Java Script code to be invoked when a key is released over this element.
  • onreset : It is used for Java Script code to be invoked when form is reset.
  • onsubmit : It is used for Java Script code to be invoked when form is submitted.
source: roseindia.net

Wednesday, August 20, 2008

JSF commandButton Tag

JSF commandButton tag has some attribute for different purposes. These attributes are explained below:

  • action: This attribute holds a value for passing values from the page to the faces-config.xml file where the operation or navigation from the page to another page is decided.
  • actionListener: The actionListener attribute of the commandButton tag is used to assign an action listener method from backing bean that performs the specific operation.
  • id: Value of the attribute is used for identifying the component uniquely. This attribute must have a unique value in the closest container.
  • immediate:It's value is a boolean value that indicates for the component events that should be sent to registered event listeners immediately. The immediate attribute allows you to turn off validation for a particular component.
  • rendered: This attribute takes a boolean value that indicates for the rendering it or not in the view.
  • value: This is the attribute holding the default value for the component whether it is specified directly or by the backing bean or any other external resources like message bundle.
  • accesskey: This is the html attribute which specify key by pressing that key the component will be focused and accessed.
  • alt: This is also a html attribute that is used for showing the textual description on mouse over of the component.
  • dir: This attribute sets the value which define the component text direction. It sets the value like "LTR" means "left-to-right" and "RTL" means "right to left" direction.
  • disabled: This attribute takes a boolean value. If the value is true then the component will be disabled otherwise the component will be enable.
  • image: This attribute takes a relative or absolute url of the image that has to be displayed on the component. The image attribute is used for showing image on the component.
  • lang: It sets the code for the language to be used in the markup generated by this component.
  • onblur: This attribute indicates the event of the component. As the value of this attribute is defined as a JavaScript method which has to be performed when the component loses the focus.
  • onchange: Specified JavaScript method is executed when the value has changed on losing focus after gaining focus.
  • onclick: In the attribute, a JavaScript method is specified that is called when the component is clicked by user.
  • ondblclick: This attribute indicates for performing the specified operation when the component is clicked two times continuously (or double click).
  • onfocus: The JavaScript method can be called for the component when the component is focused.
  • onkeydown: The specified JavaScript method or operation is performed when the key is pressed down over the component.
  • onkeypress: This is the event of the component. It indicates the key press event. You can call a JavaScript method on the event of the component whatever you have mentioned.
  • onkeyup: The specified JavaScript method is executed when key is released over this component.
  • onmousedown: Specified JavaScript method is executed when mouse is pressed down over the component or element.
  • onmousemove: This attribute sets the JavaScript code to executed when the mouse pointer is moved within the component or element.
  • onmouseout: This attribute sets the JavaScript code to execute when the mouse pointer is moved away from the element or the component.
  • onmouseover: This attribute sets the JavaScript code to execute when the mouse pointer is moved inside the element or the component.
  • onmouseup: This attribute sets the JavaScript code to executed when the mouse pointer is released from the component.
  • onselect: When you select the text contained by the component or element then the value of the attribute (JavaScript code) will be executed.
  • readonly: This attribute sets the boolean value for making the component read-only or not.
  • style: If you want ot add any CSS with the component then you can put the style as the value of the attribute. Added CSS will be applied on for the component.
  • styleClass: This attribute holds the CSS class name which is defined in the external style sheet.
  • tabindex: This attribute sets the tab index for the component. When you press the TAB key then the component will be focused after focusing all those components whose tab index is less than the component.
  • title: This attribute holds a string value that is shown as a tool-tip text of a component or element.
  • type: This attribute tells the component type whether it is submit type or reset etc.
  • binding: This attribute binds the specified value with the backing bean.

Tuesday, August 19, 2008

JSF HTML Tag Reference

n this section, you will learn more about html tags provided in JSF. JSF HTML tags are used for design the page by using server side code. This tag is used by specifying the uri and prefix attribute of the taglib directive at the top of your JSP file. These are illusrated below as follows:

http://java.sun.com/jsf/html

This is the uri for the JSF html tags. And for the prefix value commonly "h" is used but you can put anything as value of the prefix attribute of the taglib directive. When you declare any html tag as a JSF tag then you should write the tag as follows:

.

This is the syntax of specifying the html tag as a jsf tag. You can take an example of creation an input box by using jsf html tag as follows:

If the prefix value is "h" then the syntax will be seen like : .

All the html tags have been used in the Rose India JSF Tutorial as you will get one by one ahead. You can skip for next section for getting html tags overview with complete code examples that can be used directly in your web application for creating several html components as the need of your application.

source: roseindia.net

Monday, August 18, 2008

JSF Renderers

After creating JSF components, it is also necessary for each component to be rendered to the client so that it can be visible to the client’s device. Each of the tag gives rise to an associated component. A renderer is a type of class that is responsible for encoding and decoding components. Encoding displays the component while decoding translates the user’s input into components value i.e. transform it into values the component can understand.

Now a days there are many devices that are web enabled. So application developers have challenge to develop components that can work across various platforms. For example, if we have an application that works on standard web browser and we want to extend it to make it enable to work on a WAP device. So, to handle this case we need components to be rendered in more than one way. Here JSF can help you . It is a simple task for JSF. Solution is to develop separate renderers for the component. JSF components use different renderers depending on the device used.

Encoding:
For example: Suppose we have used h:inputText tag . So the renderer of the component associated with this tag produces the following output:

This is called encoding. The encoded page is sent to the browser and displayed.

Decoding:
Now if fields in form are filled by user and page is submitted by clicking the button, the browser sends the form data to the web server as a “POST” request”. POST” request contains form data and URL of the form. This form data is placed in hash table and can be accessed by all components. Each component gets a chance to look that hash table to interpret the form data. This is called decoding.

Html output Tag handler asks each component to render itself. Tag handler call two rendering methods for each component :

1-encodeBegin() in doStartTag() and

2-encodeEnd() in doEndTag().

Opening tag, like

, is written by encodeBegin() method and closing tage
, is written by encodeEnd() method. Single tag, like , that dosen’t require separate opening and closing tag is also written by encodeEnd() method.

JSF tag handler may call third rendering method encodeChildren().if rendersChilden property of component is set to true i.e. if component has child components(compound component). For example: Html table component composed of input field components as column values for each row. So for a complex component tag handler calls encodeBegin(), then encodeChildren() and encodeEnd() on the component.If the child component also has its own children component then encodeChildren() method calls encodeBegin() and encodeEnd() on the child component.

Some components renders itself (Direct rendering) and some components uses renderer to render itself (Delegated rendering). So both are different. If component uses renderer, then JSF calls encoding methods of the renderer, not the encoding method of the component. Which renderer will be used is determined by getRenderer() method of the component. So rendering of UI components is separated out that makes it pluggable with other possible rendering i.e.if we want a new functionality, like a new look and feel or rendering output to different client types, then its easy to add or plug a new renderer.

Render kit :
Component classes generally transfer the task of generating output to the renderer. All JSF components follow it. Render kit is a set of related renderers. javax.faces.render.RenderKit is the class which represents the render kit.The default render kit contains renderers for html but it’s up to you to make it for other markup languages.Render kit can implement a skin (a look & feel).Render kit can target a specific device like phone, PC or markup language like HTML,WML, SVG. This is one of the best benefit of JSF because JSF doesn't limit to any device or markup.

Sometimes we may wish to customize the renderers of an existing RenderKit and sometimes create our own RenderKit. We typically create renderers for our custom components.In this case we have to register renderers with existing RenderKits in JSF configuration file faces-config.xml.This renderer should define renderer-type of the original component. Also, you should provide the renderer-class that points to your custom renderer. The renderer class should extend javax.faces.render.Renderer class.



........
........



The information mentioned in configuration file registers the renderer with the default html RenderKit. UI component's geRendererType() method is called that returns a string to identify the type of renderer that would be used by component and to see if it should delegate rendering to a renderer. If no matching render type is found then component renders itself without delegating to any renderer.


...........
........


.........
........


In this case, configuration file shows how to register the renderer (for ex. ButtonRenderer) specified in which renders a component (for ex. Button) specified in to a client (for ex. SVG) specified in .

Standard render kits:
JSF defines a standard RenderKit and set of associated Renderers that generate html markup. Renderer will be determined and handled automatically according to the tag used.

sourse: roseindia.net

Sunday, August 17, 2008

JSF Architecture

JSF was developed integrating MVC design pattern so that applications can be designed well with greater maintainability. To understand this fact we need to understand what is MVC design pattern, how MVC helps to design an application well and how can we make our web application easy to maintain.

The MVC design pattern splits an application design into three separate parts:

Model : handles data and logic.

View : handles output (presentation)

Controller: handles processing of an application.

MVC model’s purpose is to separate model and presentation to enable developers to set focus on their core skills and collaborate more clearly. If you have to create many pages for presentation then you have to concentrate only on view layer rather than model and controller layer because you can reuse code for controller and model.

In the same way if you want to change the code for model then you typically need not to change view layer.

Controllers are used to process user actions. In this process layer model and views may be changed.

The best advantages of JSF is that it is both a Java Web user-interface standard and a framework that fits well with the Model-View-Controller (MVC) design pattern. It offers a clean separation between presentation and behavior. MVC pattern helps persons of different skill sets to work separately so tasks can be completed in parallel. UI can be created by page author using reusable UI components and business logic part can be implemented using managed beans.

source: roseindia.net

Friday, August 15, 2008

JSF Life Cycle

In this we will understand the life cycle of JSF application.

Life cycle of a JSF web application starts when user makes a request. On submission of a page various further tasks are performed like validation of data provided in components in the view, data conversion according to types specified on server side etc. So series of steps that an application follows is called life cycle.

A JSF application typically follows six steps in its life :

1. Restore view phase :

This phase starts when a user requests a JSF page by clicking a link, button etc. In this phase view generation of the page, binding of components to its event handlers and validators are performed and view is saved in the FacesContext object. The FacesContext object contains all the state information JSF needs to manage the GUI component's state for the current request in the current session. The FacesContext stores the view in its viewRoot property.All the JSF components are contained by viewRoot for the current view ID. Component tree of a page is newly built or restored.
A request comes through the FacesServlet controller. The controller checks the request and takes the view ID i.e. name of the JSP page. View ID is used to look up the components in the current view. JSF controller uses this ID if the view already exists . If the view doesn't already exist, the JSF controller creates it. The created view contains all components.

2. Apply request values phase :

The purpose of this phase is for each component to retrieve its current state. After restoring of component tree in previous phase each component in the tree retrieves its new value and store it locally. Component values are typically retrieved from the request parameters.If immediate attribute of a component is set to true, then the validation, conversion, and events associated with the component is processed in this phase.

If a component's immediate event handling property is not set to true, the values are converted. Suppose field is bound to be an Integer property, the value is converted to an Integer. An error message associated with the component is generated if this conversion fails, and queued in the FacesContext. This message will be displayed during the render response phase, along with any validation errors resulting from next process validation phase.

At the end of this phase, the components are set to their new values, and messages and events have been queued.

3. Process validations phase :

During this phase local values stored for the component in the tree are compared to the validation rules registered for the components. If local value is invalid, an error message is added to FacesContext, and the component is treated invalid then JSF proceeds to the render response phase and display the current view showing the validation error messages. If there were conversion errors from the apply request values phase, the messages for these errors are also displayed. If there are no validation errors, JSF proceeds ahead to the update model values phase.

4. Update model values phase :

After confirming that data is valid in the previous phase local values of components can be set to corresponding server side object properties i.e. backing beans. So bean properties will be updated .If the local data cannot be converted to the types specified by the bean properties, the life cycle proceeds directly to the render response phase and errors are displayed.

5. Invoke application phase :

Before this phase the component values have been converted, validated, and applied to the bean objects, so you can now use them to execute the application's business logic. Application-level code is executed such as submitting a form or linking to another page.For example user moves to the next page you will have to create a mapping in the faces-config.xml file. Once this navigation occurs, you move to the final phase of the lifecycle.

6. Render response phase:
In this phase JSP container renders the page back to the user,if jsp is used by application i.e. view is displayed with all of its components in their current state.If this is an initial request, the components will be added to the component tree. If this is not an initial request, the components are not added because they are already added to the tree.The state of the response is saved after rendering of the content of the view, so that subsequent requests can access it and it is available to the restore view phase.

source: roseindia.net

Tuesday, August 12, 2008

JSF Tags

JSF application typically uses JSP pages to represent views. JSF provides useful special tags to enhance these views. Each tag gives rise to an associated component. JSF provides 43 tags in two standard JSF tag libraries:

  1. JSF Core Tags Library and

  2. JSF Html Tags Library

Even a very simple page uses tags from both libraries.

<%@ taglib uri=”http://java.sun.com/jsf/core “ prefix=”f” %>
<%@ taglib uri=”http://java.sun.com/jsf/html “ prefix=”h” %>

……………
……………



In the above code fragment we have imported two JSF tag libraries with the help of taglib directive. JSF Core Tag Library contains set of JSF core tags while JSF Html Tags Library contains set of html tags. Prefix is used to use tags defined in tag library. Here we are using conventional names f and h for Core & Html tags respectively. We have the choice to choose any name for the prefixes.

  • JSF Html Tags:

    These tags represent html components like text fields, buttons, form.
    Html tags can be divided into following categories:

    Inputs (inputText, inputTextarea)
    Outputs (outputText, outputLabel)
    Commands (commandButton)
    Selections (selectOneRadio, selectOneListbox, selectOneMenu for radio buttons, list boxes, menu etc)
    Layouts (panelGrid)
    Data table (dataTable)
    Errors and messages (message, messages)

    Some examples have been given below to understand how to use these tags and its attributes:

    <h:inputText id=”ID1” value=”value”/>
    creates a single line text input control where id attribute is used to uniquely identify the component rendered by this tag and value attribute sets the current value of the component.

    <h:outputText id="ID2" value="Welcome"/>
    creates a single line text output where id attribute uniquely identifies the rendered component and current value is set by value attribute .

    <h:commandButton
    id="submit"
    value="go"
    action="nextPage">
    </h:commandButton>

    creates a command button where value attribute sets the value that is displayed on the button when it is rendered and action attribute is used to invoke a method defined in backing bean when a user does an action on the component .According to the return of the invoked method it is determined which view is to be displayed next.


    In JSF Html Tag Library there are 25 core tags .

    All JSF Html Tags :

    • column creates column in a dataTable
    • commandButton creates button
    • commandLink creates link that acts like a pushbutton
    • dataTable creates a table control
    • form creates a form
    • graphicImage displays an image
    • inputHidden creates hidden field
    • inputSecret creates input control for password
    • inputText creates text input control (single line)
    • inputTextarea creates text input control (multiline)
    • message displays the most recent message for a component
    • messages displays all messages
    • outputFormat creates outputText, but formats compound messages
    • outputLabel creates label
    • outputLink creates anchor
    • outputText creates single line text output
    • panelGrid creates html table with specified number of columns
    • panelGroup used to group other components where the specification requires one child element
    • selectBooleanCheckbox creates checkbox
    • selectManyCheckbox creates set of checkboxes
    • selectManyListbox creates multiselect listbox
    • selectManyMenu creates multiselect menu
    • selectOneListbox creates single select listbox
    • selectOneMenu creates single select menu
    • selectOneRadio creates set of radio buttons
  • JSF Core Tags:

    These tags allows you to take advantages of features of JSF framework, like validation, conversion , event handling. Core library is stepchild of Html library. i.e. core library supports the html library. Core tag library also contains tags for views and sub-views , loading resource bundle, adding arbitrary text to a page. Some examples of JSF core tags are:

    f: view tag is used to create top level view
    f: subview tag is used to create subview of a view.
    f: validator tag is used to add a validator to a component.
    f: converter tag is used to add an arbitrary converter to a component.
    f: actionListener tag is used to add an action listener to a component.
    f:valueChangeListener tag is used to add a valuechange listener to a component

    Some examples have been given below to understand how to use these tags:

    <f:view locale="en">

    </f:view>
    f: view tag is used to create top level view and is a container for all JSF component tags on a page. Where locale attribute provides several options for presenting localized views of your application. Here "en" represents English and if we give velue "fr" to locale attribute then french view will be displayed. So this attribute is useful for internationalization purpose.


    head


    view


    <f:subview id="sub_id">

    </f:subview>

    Here f:subview tag is like container for the JSF components contained in an included JSP page (second.jsp).


    <f:validator validatorId="Txt_Validator" />

    The Validator tag registers a Validator on the component associated with the enclosing tag. In validatorId field, we give the value of one of the validator-id element of a validator in your Faces configuration file.

In JSF Core Tag Library there are 18 core tags .

All JSF Core Tags:

  • f :view Creates the top-level view
  • f:subview Creates a subview of a view
  • f:attribute Adds an attribute to a component
  • f:param Constructs a parameter component
  • f:converter Adds an arbitrary converter to a component
  • f:converterDateTime Adds a datetime converter to a component
  • f:converterNumber Adds a number converter to a component
  • f:actionListener Adds an action listener to a component
  • f:valueChangeListener Adds a valuechange listener to a component
  • f:validator dds a validator to a component
  • f:validateDoubleRange Validates a double range for a component’s value
  • f:validateLength Validates the length of a component’s value
  • f:validateLongRange Validates a long range for a component’s value
  • f:facet Adds a facet to a component
  • f:loadBundle Loads a resource bundle, stores properties as a Map
  • f:selectitems Specifies items for a select one or select many component
  • f:selectitem Specifies an item for a select one or select many component
  • f:verbatim Adds markup to a JSF page

source: roseindia.net

SF Components

Components in JSF are elements like text box, button, table etc.. that are used to create UI of JSF Applications. These are objects that manage interaction with a user. You can create :

  1. Simple components, like text box, button and

  2. Compound components, like table, data grid .

A component containing many components inside it is called a compound component. Components help developers to create UIs by assembling a number of components , associating them with object properties and event handlers. Would u like to repeat the same code again & again and waste time if u want to create many tables in hundreds of pages in your web application? Not at all. Once you create a component, it’s simple to drop that component onto any JSP.

JSF allows you to create and use components of two types:

  1. Standard UI Components:
    JSF contains its basic set of UI components like text fields, check boxes , list boxes, panel , label, radio button etc. These are called standard components. For example:

    UIForm represents a user input form that is a container of other components.
    UICommand represents UI components like buttons, hyperlinks and menu items.
    UIInput represents UI components like text input fields, numeric input fields.

  2. Custom UI Components:
    Generally UI designers need some different , stylish components like fancy calendar, tabbed panes . These types of components are not standard JSF components. JSF provides this additional facility to let you create and use your own set of reusable components .These components are called custom components.

    One of the greatest power of JSF is to support third party components .Third party components are custom components created by another vendor. Several components are available in the market ,some of them are commercial and some are open source . You can use these pre-built & enhanced components in UI of your web application .Suppose u need a stylish calendar , u have an option to take it from third party rather than creating it .This will help you to save your time & cost creating effective & robust UI and to concentrate on business logic part of web application.
    If u want to create custom components then its necessary to either implement UIComponent interface or extend UIComponentBase class that provides default behavior of components. These may be responsible for its own display or the renderer is used for its display. These components are stored in component tree on the server and they maintain state in between client requests. These components are manipulated on the sever in java code.
    So the final conclusion of using third party components is that a more attractive , robust and functional UI can be created with fewer time, cost and man power.

source: roseindia.net

Sunday, August 10, 2008

How JSF Fits For Web Applications?

JSF best suits in to the java web development environment because of reasons described below : JSF has many advantages over other existing frameworks that makes it a better choice for web application development. Some of the reasons are below:

Easy creation of UI:
It makes easier to create complex UI for an applicaton using jsf tags.Its APIs are layered directly on top of servlet APIs that enables us to use presentation technology other than JSP,creating your own custom components and rendering output for various client devices.

Capacity to handle complexities of UI management:
It handles cleanly the complexities of UI management like input validation, component-state management, page navigation, and event handling.

Clean separation between presentation and logic:
One of the greatest advantage of jsf is to clearly separate behaviour and presentation in an application. JSF is based on the Model View Controller (MVC) architecture.

Shorter development cycle:
This separation between logic and presentation enables a wide range of users( from web-page designers to component developers). It allows members of team to focus on their own work only , resulting in division of labour and shorter development cycle.

Standard Java framework:
JSF is a Java standard which is being developed through Java Community Process (JCP). Several prominent tool vendors are members of the group and are committed to provide easy to use, visual, and productive develop environments for JavaServer Faces.

An extensible architecture:

JSF architecture has been designed to be extensible.Extensible means additional functionality can be given on the top of JSF core i.e. we can customize the functionality. JSF UI components are customizable and reusable elements. You can extend standard components and create your own complex components like stylish calendar, menu bar etc.

Support for multiple client devices:
Component developers can extend the component classes to generate their own component tag libraries to support specific client. JSF flexible and extensible architecture allows developers to do so.

Flexible rendering model:
Renderer separates the functionality and view of the component. So we can create multiple renderers and give them different functionality to get different appearance of the same component for the same client or different .

International language support:
Java has excellent support for internationalization . It allows you to localize messages with user specific locale. A locale is a combination of a country, a language, and a variant code. JavaServer Faces adopts this property and let you specify which locale your application supports. So you can display you messages in different languages.

Robust tool support:
There are several standard tool vendors like Sun Java Studio Creator who provide robust tools that take advantages of JSF to create server side UI easily.

source: roseindia.net

Friday, August 08, 2008

JSF Features

JSF is a rich featured framework of JAVA technology. JSF provides a set of standard features that makes it a powerful and standard among the existing technologies available for the development of web application based on java technologies. Some of the features have been given below to justify the above statement.

  1. JSF is standard web user interface framework for Java.
  2. Built on top of Servlet API.
  3. JSF is a component framework
  4. UI components are stored on the server.
  5. Easy use of third party components.
  6. Event driven programming model.
  7. Events generated by user are handled on the server.
  8. Navigation handling.
  9. Can automatically synchronize UI components .
  10. JSF supports multiple client devices.
  11. JSF has extensible architecture.
  12. International language support.
  13. Extensive tool support (Sun, Oracle , IBM etc.).
  14. Rapid application development approach.

A short view of jsf features has been given above. Its main features are component model, event driven, extensible architecture, rapid application development. All of the features will be described in subsequent topics.

source: roseindia.net

Thursday, August 07, 2008

JSF Versions

JSF started its journey from version 1.0 and now it has come to the latest version of JSF is 1.2. The listing of versions released so far are :

  1. JSF 1.2 (11 may 2006) - Latest release of JSF specification.
  2. JSF 1.1 (27 may 2004) - Bug fix release. No specification changes. No HTML renderkit changes.
  3. JSF 1.0 (11 mar 2004) - Initial release of JSF specification.

There are many releases of 1.1 and 1.2 and these are listed below showing released date also:

  1. 1.2_04 P01 (20 Mar 2007)
  2. 1.2_04 (5 Mar 2007)
  3. 1.2_02 (25 Aug 2006)
  4. 1.2_01 (14 July 2006)
  5. 1.1_02 (24 Apr 2006)
  6. 1.1_01 (07 Sep 2004)

The JSF specification was developed under the Java Community Process (JCP) as JSR 127, which released JSF 1.0 and 1.1, and JSR 252 which released JSF 1.2. The first release of JSF is JSF 1.0 in 2004. JSF 1.0 supports servlet 2.3 and jsp 1.2. After JSF 1.0, JSF 1.1 was released. The main purpose of this release was bug-fixing. There were no specification or HTML renderkit changes. This version also works with same version of servlet 2.3 and jsp 1.2 as in the case of JSF 1.0.

JSF 1.1_01 release features bug fixes and performance improvements. Improvements include compression of views serialized to the client, failover support when storing views on the server, renderer fixes, and several other bug fixes and enhancements.It supports JDK 1.3.1 or later. Many bugs have been fixed so if your application depends on one of these bugs, it needs to be changed.

JSF 1.2 is the latest release and it works with servlet 2.5 and jsp 2.1. If you want to run JSF 1.2 on Tomcat, you want 6.0 not 5.5. So JSF needs a web container that supports atleast servlet 2.3 and jsp 1.2 and these are part of J2EE 1.3.

New in JSF 1.2

In this section we will go through some new features and changes in JSF 1.2 specification. JSF 1.1 was designed for JSP 1.2 and so could not take advantage of newer JSP features and JSP could not be changed to fill the needs of JSF. This resulted in a number of new features and changes. For ex.

  1. Unified Expression Language(EL) :
    Unified EL has been added to JSTL to overcome problems when integrating JSP EL with the JSF EL.EL was used to access data objects in a simple way. It is used mainly as a short-hand for accessing values. Later it was included in JSP 2.0 with more functionality.When JSF was released it also needed EL.JSF and JSP each has its own EL.The JSP EL is much flexibile to the web application developer but JSF people were unsatisfied by the JSP EL.One of the reason was that it requires JSP engine to evaluate expression at the appropriate time during the lifecycle, but JSP expressions are evaluated immediately. The second reason behind it was that JSP functions could only call static methods in TLD and they cannot be used to invoke public methods dynamically on server side objects during lifecycle to validate data and handle component evevts.
    So these were the reasons for developing such an EL that would work for both JSP and JSF and make using JSP and JSF together easier. This new EL is called unified EL. So this was inspired by EL used in JSTL and JSP. There is a package "el" in javax package that represents EL.

    In addition to the features already available in the JSP EL, unified EL has the following features :
    1. Deferred evaluation of expressions i.e.evaluation of the expression at the appropriate time during the page lifecycle from JSP engine.
    2. Support for expressions that can set and get values
    3. Support for expressions that can invoke methods.
    4. A pluggable API for resolving expressions
  2. Ajax Support :
    JSF framework can make things a little easier to write AJAXian JSF components.JSF allows to map different instances of the FacesServlet with different lifecycles.For example, one mapping for standard JSF requests and another for AJAX JSF requests.
  3. New Tree Creation and Content Interweaving Model for Faces applications that use JSP :
    We can make JSF application without using any JSP page but it can also be developed using both JSP and JSF.Using JSP makes some developers easy to handle.Sometimes When integrated it did not respond as we expect. These problems have been resolved in JSF 1.2.There have been made some changes in specification of the implementation of the FacesViewHandler for JSP and JSP custom tag base class.
  4. Integration with JSTL :
    Using JSTL's tag to contain Faces input components was one of the problem, because JSP has no notion of a postback, it was not possible to apply the values correctly to the nested input components on postback. Some new concepts in EL make it possible to use this tag fully with any kind of JSF component.
  5. Back Button issues and Multi Frame or Multi Window Faces Apps :
    JSF have fixed the problem related to Multi Frame or Multi Window applications.The browser back button also created some problems. These problems were because of deficiency in the State Management API.
  6. Associating a message with a particular component in the page :
    Previously we could not include label of a component dynamically in an error message for that component. Now it's possible in new JSF 1.2.It's also possible to override the conversion or validation message that is displayed to the user on a per-instance basis.
  7. Expose an application wide ResourceBundle to the EL :
    element in faces-config allows listing many resource bundles that should be exposed to the EL using the new ELResolver chain.This optimize performance and prevent the need to create a ResourceBundle for every request.
  8. Use of multiple renderKits.
  9. Provide XML Schema for the config files, instead of using DTD.
  10. Security enhancements for client side state saving.
  11. Solve the "duplicate button press" problem.
  12. The portlet related bug-fixes.

JSP 2.1 is developed under JSR-245 and JSF 1.2 is developed under JSR-252. These two groups have experts and they are working independently but the main focus of development was to provide more support and compatibility between these two technology that are powerful web presentation technology so that they can be useful for each other.

source: roseindia.net

Tuesday, August 05, 2008

What is JSF?

In this section "What is JSF?" you will get detailed overview of JSF technology, which is ready to revolutionize the web application development process. JSF is complex system but you will be highly benefited by JSF technology. For example, you can easily make rich graphical Web application that can't be easily developed in HTML. Here we have tried to explain the JSF in easily understandable manner so that beginner can also understand easily.

What is JSF?

JSF is new standard framework, developed through Java Community Process (JCP), that makes it easy to build user interfaces for java web applications by assembling reusable components in a page. You can think of JSF framework as a toolbox that is full of ready to use components where you can quickly and easily add and reuse these components many times in a page and capture events generated by actions on these components. So JSF applications are event driven. You typically embed components in a jsp page using custom tags defined by JSF technology and use the framework to handle navigation from one page to another. Components can be nested within another component , for example, input box, button in a form.

JSF is based on well established Model-View-Controller (MVC) design pattern. Applications developed using JSF frameworks are well designed and easy to maintain then any other applications developed in JSP and Servlets.

JSF eases the development of web applications based on Java technologies. Here are some of benefits of using JSF:

  • JSF provides standard, reusable components for creating user interfaces for web applications.

  • JSF provides many tag libraries for accessing and manipulating the components.

  • It automatically saves the form data and repopulates the form when it is displayed at client side.

  • JSF encapsulates the event handling and component rendering logic from programmers, programmers just use the custom components.

  • JSF is a specification and vendors can develop the implementations for JSF.

  • There are many GUIs available these days to simplify the development of web based application based on JSF framework.

JSF Components

JSF includes mainly:

  1. Set of APIs to represent and manage state of components that helps server side validation, event handling, page navigation, data conversion etc.
  2. JSP custom tag library to create UI components in a view page.
The UI (user interface) created using JSF technology runs on server and output is shown to the client. Goal of JSF is to create web applications faster and easier. Developers can focus on UI components, events handling, backing beans and their interactions rather than request, response and markup. JSF hides complexities to enable developers to focus on their own specific work.

source: roseindia.net

Monday, August 04, 2008

JSF Overview

The quick Overview of JSF Technology

This section gives you an overview of Java Server Faces technology, which simplifies the development of Java Based web applications. In this JSF overview section you will learn how JSF fits into the web application development landscape.

JSF was developed by Java Community Process(JCP). This is a community of web application experts. These experts are from different groups like Jakarta Struts, Oracle, Sun, IBM, ATG etc. They all collectively worked together to take the best from existing technologies and removed problems. So their collective effort brought a new technology named Java Server Faces (JSF).

Java Server Faces or JSF for short, is the standard framework to simplify the process of developing web application in java. It is a robust component framework, event driven programming model. It offers a set of UI components, extensible architecture, supports multiple client devices etc. Extensible means additional functionality can be given on the top of JSF core i.e. we can customize the functionality. JSF is vendor independent technology that is a standard to be supported by whole software industry.

One of the main feature of JSF is that it has not only been designed for coding experts but for others also like :

  1. Page authors
    Web designers have experience with graphic design. They can design look and feel of web application in html/jsp using custom tag libraries of JSF.
  2. Application developers
    Application developers can integrate this design with UI components. They program objects, event handles, converters, validators.
  3. Component writers
    Component developer can build custom UI components because of JSF’s extensible and customizable nature. They can create their own components directly from UI component classes or extending the standard components of JSF.
  4. Application architects
    Application architects are responsible for designing web applications. Defining page navigation, ensuring Scalability of application, configuring beans object registration are the key points that an application architect handles.
  5. Tool vendors
    JSF is well suited for tool vendors, for example Sun Java Studio Creator application development tool, who provide tools that take advantages of JSF to create UI easier.

In the past many web development frameworks came in to existence founded on servlet and jsp. Struts emerged as a standard web application framework. It became framework of choice because it came early in the market and provided necessary features at the time but competitors continued providing additional features that struts lacks. So it became necessary for java to advent new standard framework with a powerful component model. This was the reason for developing JSF technology. So main purpose of developing JSF was to create a collection of APIs for the UI components with the capacity to manage their states, handle events and validation.

Struts has an option to migrate to JSF. The simplest option is to use JSF components and rest as usual. This will enable them to take advantage of third party JSF components. Main feature of JSF is ease of use. Developing web applications is easier and faster than other frameworks like struts because JSF supports UI components and easy event handling. Taking advantages of third party components can reduce the cost of rewriting existing elements, minimize the time of development.


source: roseindia.net

Saturday, August 02, 2008

JSF Introduction - An Introduction to JSF Technology

Java Server Faces or JSF for short is another new exciting technology for developing web applications based on Java technologies. This JSF Introduction section introduces you with cool JSF technology. In this "JSF Introduction" section you will be introduced with the JSF technology, reasons that initiated the development of JSF and the benefits of JSF.

Why JSF?

Let's first understand the reasons that initiated the JSF project and why JSF is so hot these days. There are reasons for development of new framework in-spite of many already existing technologies like JSP, Servlets, Struts etc... If you have developed complex web based applications in jsp then you must be knowing the problem faced with those technologies. Here are the list of some of the problems faced with the previous technologies like JSP and Servlets:

  • Tedious and repetitive coding
    Previous technologies like JSP make programmer to do a lot of tedious and repetitive coding.
  • Directly working with HTTP request and response
    Using these technologies programmers directly work with HTTP request and response objects and manipulates the data. For example if user submits the registration form then programmer writes the code to get the values of each element in the form into a variable for further processing. When there is a need to retrieve the data from database and then show on the form for editing, then in this case programmer writes the code to retrieve the code from database and then set the values in the forms.
  • Non availability of IDE
    Non availability of IDE is another major drawback which affects the programmers productivity and development cost of the projects increases.

JSF changes all that by giving intuitive framework to the developers. Furthermore, JSP is specification and many vendors are developing their own implementations. Both free and commercial implementations of JSF are available these days. You can choose any one of them based on your requirement and budget.

Now a days software vendors are developing IDE for developing JSF based applications which is another good news for the learners of JSF framework. Once you are familiar with the core concepts of the JSF you can kick start the development of software projects using any IDE available in the market. These changes in the programming world makes the life of programmer much easier.

Java Server Faces is a component oriented and event driven framework for web applications. JSF eases the development of GUI for web applications. JSF allows the programmers to work with extensible user interfaces like buttons, text boxes, check boxes etc... Programmer writes the code for particular event such as button clicked. This makes programming much easier and now the there is no need to write request and response processing logic.

source: roseindia.net

Friday, August 01, 2008

JSF - Java Server Faces Tutorials

Complete Java Server Faces (JSF) Tutorial - JSF Tutorials. JSF Tutorials at Rose India covers everything you need to know about JSF.

Our JSF tutorial comes with free source code and configuration files that makes JSF learning easy and fast. You can download all the codes in easy to use zip format from our website. In our JSF tutorials we will describe you how to implement all theoretical concepts of JSF in developing robust JSF web application.

This JSF Tutorial contains readable and interesting content organized in proper and sequential manner. Each concept has been explained by simple examples so that you can understand easily and implement immediately into your java web application. It provides coverage of key JSF concepts such as User Interface(UI) components, Renderers, Backing beans, Validators, Converters, Navigation, Event handling, Expession language, Messages etc...

Java Server Faces (JSF) is a great JAVA technology in the field of web application development. This tutorial at RoseIndia is the best place to go through JSF concepts in easy and sequential way. This tutorial will take you through the basics of JSF to developing robust JSF web applications. This is the complete guide to understand JSF, work flow of JSF, benefits of JSF over existing frameworks. It is natural to think about learning and adopting new framework while there exists some established and popular frameworks in present web development landscape. This tutorial contains all you need to know about this new emerging and robust technology of JAVA. It is the best combination of existing frameworks as it has been developed by taking best features from all and leaving and removing the rest bad. You can think about this fact that it has been developed by JCP (Java Community Process) of web application experts from different groups like Jakarta Struts, Oracle, Sun, IBM, ATG etc. They all collectively worked together to take the best from existing technologies and removed problems. So their collective effort brought a new technology named Java Server Faces (JSF).

Follow the following links to learn JSF fast:

  1. Introduction To JSF
    Java Server Faces or JSF for short is another new exciting technology for developing web applications based on Java technologies. This JSF Introduction section introduces you with cool JSF technology.
  2. JSF Overview
    JSF was developed by Java Community Process(JCP).This is a community of web application experts. These experts are from different groups like Jakarta Struts, Oracle, Sun, IBM, ATG etc. They all collectively worked together to take the best from existing technologies and removed problems.
  3. What Is JSF?
    JSF is new standard framework, developed through Java Community Process (JCP), that makes it easy to build user interfaces for java web applications by assembling reusable components in a page.
  4. JSF Releases
    The JSF specification was developed under the Java Community Process (JCP) as JSR 127, which released JSF 1.0 and 1.1, and JSR 252 which released JSF 1.2. The first release of JSF is JSF 1.0 in 2004. JSF 1.0 supports servlet 2.3 and jsp 1.2. After JSF 1.0, JSF 1.1 was released. The main purpose of this release was bug-fixing. There were no specification or HTML renderkit changes. This version also works with same version of servlet 2.3 and jsp 1.2 as in the case of JSF 1.0.
  5. JSF Features
    JSF is a rich featured framework of JAVA technology. JSF provides a set of standard features that makes it a powerful and standard among the existing technologies available for the development of web application based on java technologies.
  6. How JSF Fits For Web Applications?
    JSF has many advantages over other existing frameworks that makes it a better choice for web application development.
  7. JSF Components
    Components in JSF are elements like text box , button , table that are used to create UI of JSF Applications. These are objects that manage interaction with a user.
  8. JSF Tags
    JSF application typically uses JSP pages to represent views. JSF provides useful special tags to enhance these views. Each tag gives rise to an associated component.
  9. JSF Life Cycle
    Life cycle of a JSF web application starts when user makes a request. On submission of a page various further tasks are performed like validation of data provided in components in the view, data conversion according to types specified on server side .
  10. JSF Architecture
    JSF was developed integrating MVC design pattern so that applications can be designed well with greater maintainability.
  11. JSF 1.2.
    1. JSF 1.2 Tutorials TOC
      Here we will provide you many examples on JSF 1.2, which will help you learn JSF 1.2 (Java Server Faces 1.2) easily. After going through all our JSF 1.2 tutorial you will master JSF 1.2.
    2. New Features in JSF 1.2
      JSF 1.2 is the latest release of Java Server Faces technology. In this section we are discussing the new features of Java Server Faces 1.2 specification.
    3. Installing JSF 1.2 on tomcat
      In this tutorial we will explain you how to install JSF 1.2 on tomcat server. We will develop small web application to test our integrated environment.
    4. Developing Form based application using JSF 1.2
      In this tutorial we will show you how to develop UI forms using JSF 1.2. After completing this tutorial you will be able to develop user entry forms in JSF 1.2 technology.
    5. Using Properties File in JSF
      In this section you will learn how to use properties file in JSF applications to display the message from message source files. We will use the application developed in the last section and modify the application to use properties files.
    6. JSF Form Validation
      In this section on "JSF Form Validation" you will learn how to validate the JSF Form using tag libraries provided along with JSF 1.2 implementation.

    JSF 1.1 Tutorials

  12. JSF Renderers
    After creating JSF components, it is also necessary for each component to be rendered to the client so that it can be visible to the client’s device. Each of the tag gives rise to an associated component .
  13. JSF HTML Tag Reference
    In this section, you will learn more about html tags provided in JSF.
    • JSF column Tag
      This section tells you about the JSF html column tag which is used for creating columns of a table. This tag creates a data column inside a data table.
    • JSF commandButton Tag
      This section illustrates more about commandButton tag in JSF. This tag renders an HTML submit button. This button can be associated with bean.
    • JSF commandLink Tag
      This section illustrates you about the JSF commandLink tag which is rendered as a anchor tag.
    • JSF dataTable Tag
      This tag is used to create table on the page. The component is rendered as an html element.
    • JSF form Tag
      This tag renders html form element which contains the data that is submitted with the form. This tag uses "POST" method.
    • JSF graphicImage Tag
      This section explains about "graphicImage" tag. This displays the image on the page. This tag renders an html "img" element.
    • JSF inputHidden Tag
      This section describes the inputHidden JSF tag. This tag is used to create the field that is invisible to the user.
    • JSF inputSecret Tag
      This section illustrates you more about the JSF HTML inputSecret tag. This tag is used to create a text box for having password that is secret.
    • JSF inputText Tag
      This tag is used to create html input element which has the type "text". It creates input text field where text can be entered.
    • JSF inputTextarea Tag
      This tag is used to render html "textarea" element . It creates input text area where text can be entered in multiple lines.
    • JSF message Tag
      In this section we will explain you JSF message tag. This is used to display the most recent message for the component.
    • JSF messages Tag
      This tag is also like message tag which is also used to show all messages for the components. If you want to customize the message then CSS can be used.
    • JSF outputFormat Tag
      This section illustrates you about the JSF outputFormat tag. This tag is used for showing output with the parameterized text that facility allows you to customize the appearance of the text using CSS styles also.
    • JSF outputLabel Tag
      This is the outputLabel tag which show the text labeled with the specific component created in your application.
    • JSF outputLink Tag
      This is the outputLink which show the output text holding a link of a page or a website location. This link is similar from the link created by the JSF commandLink tag text.
    • JSF outputText Tag
      This is the section in which you can learn more about the tag named outputText tag. This tag is used for creating component for displaying formatted output as text.
    • JSF panelGrid Tag
      This tag is used create compound component that is used to layout other components. This tag renders html table with specified no. of columns.
    • JSF panelGroup Tag
      This is used to create a component that acts as a container to group a set of components. All these components are under one component or can say one parent.
    • JSF selectBooleanCheckbox Tag
      This section explains you creating checkbox by JSF tag. selectBooleanCheckbox tag is used to create checkbox.
    • JSF selectManyCheckbox Tag
      This section is to describe you selectManyCheckbox tag of JSF. It is used to provide the user to select many items from a list of options. The user can select one or more options.
    • JSF selectManyListbox Tag
      This section is dedicated to describe you about selectManyListbox tag. This lets you select more than one options from a set of available options.
    • JSF selectManyMenu Tag
      In this section "selectManyMenu" tag will be discussed. This is used to select more than one items from a set of options.
    • JSF selectOneListbox Tag
      This section describes you about selectOneListbox tag in detail. This is used when you have to allow the user to select only one option from the list.
    • JSF selectOneMenu Tag
      This is the section where you will learn about "selectOneMenu" tag. This is used to display the element that enables the user to select only one among the list of available options.
    • JSF selectOneRadio Tag
      This section is in concern with discussing about "selectOneRadio" tag. This allows the user to select one option from a set of available options.
    • JSF Core Tag Reference
      This section is dedicated to make you understand about JSF Core Tags. All these core tags are contained in JSF Core Tag Library.
      • JSF actionListener Tag
        This tag is used to add a action listener to the component associated with the enclosing tag. When user does an event on the component then this action takes place.
      • JSF attribute Tag
        This tag is used to add attribute to the nearest parent component. This is name/value pair where name takes the attribute name which will be set to the component and value takes the value of the attribute.
      • JSF convertDateTime Tag
        This tag is useful converting date and time according to your format.
      • JSF converter Tag
        This tag is used to register the converter instance on the enclosing component. Many times it is required to convert the input to the appropriate type.
      • JSF convertNumber Tag
        This tag is used to register the NumberConverter instance on the enclosing component.
      • JSF facet Tag
        This tag is used to add a facet to the component means this tag is used to add its child as a facet of the closest parent component.
      • JSF loadBundle Tag
        This tag is used to load the recourse bundle and store it as a map in the request scope.
      • JSF param Tag
        This tag is used to set the parameter to the enclosing component. This tag is helpful in the case of creating the compound message.
      • JSF selectItem Tag
        This tag is used to add a child component to the component associated with the enclosing tag. In this section you will learn about the selectItem tag.
      • JSF selectItems Tag
        This tag is used to add a set of items to the nearest enclosing parent (select one or select many) component.
      • JSF subview Tag
        This tag is used to create the sub-view of the view. It contains all JSF tags in a page that is included in another JSP page. It acts as a naming container so that the components inside it can be made unique.
      • JSF validateDoubleRange Tag
        This is one of the standard validators provided by JSF to check whether the floating point value (or that can be converted to floating point) entered in the corresponding input component is within the certain range.
      • JSF validateLength Tag
        If you want the user to input the number of characters between the certain range, suppose you want the user to fill password of more than 6 characters then this tag can be used to validate.
      • JSF validateLongRange Tag
        This is one of the standard validators provided by JSF to check whether the local value (a numeric value or any string that can be converted to a long.) entered in the corresponding input component is within the certain range.
      • JSF validator Tag
        This tag is used to add and register the validator to the nearest parent component. Typically all applications requires filling some or more information in the page.
      • JSF valueChangeListener Tag
        This tag is used to add a value change listener to the component associated with the enclosing tag. Value change event is fired when the user changes the input value.
      • JSF verbatim Tag
        This tag renders output component (UIOutput) within the closest component. It takes the content from the body of this tag.
      • JSF view Tag
        This tag is used to create the top level view. This acts as a container of all the components that are part of the view of the page.
    • JSF Facelet Tag Reference
      This section is dedicated to make you understand about JSF Facelet Tags. All these Facelet tags are contained in JSF Facelet Tag Library.
      • Facelet component Tag
        This tag is used to add a new component into the JSF component tree as children of UI component instance.
      • Facelet composition Tag
        This is a templating tag and is used for the wrapping the content that can be included in any other facelet. This tag provides some useful features.
      • Facelet debug Tag
        This tag is useful in displaying the component tree and scoped variables. This information will be displayed in a popup window of browser when we press Ctrl+Shift+(a key).
      • Facelet decorate Tag
        This tag is like composition tag. Difference between those is that the content outside of the decorate tag is rendered while it is reverse for composition tag i.e. it is not rendered when we use composition tag.
      • Facelet define Tag
        This tag is used to define the name of the content. This named content can be included within a template. This tag is used within those tags that allows templating like composition and decorate tags.
      • Facelet fragment Tag
        This tag is used to insert the new UIcomponent to the component tree and the content outside of the tag is included to the tree.
      • Facelet include Tag
        This tag is used to include the content of a page. This page name is specified by src attribute of include tag. The page that has been included should use composition tag or component tag.
      • Facelet insert Tag
        This tag is used to replace the content defined in another facelet to the template. This tag takes one attribute that is not a required attribute and is used in conjunction with define tag.
      • Facelet param Tag
        This tag is used to set the parameter to the enclosing component. This tag is helpful in the case of creating the compound message.
      • Facelet remove Tag
        This tag is used to remove content within this tag from a facelet at compile time. This tag don't have any attribute. This tag can be used with jsfc attribute which shows that the particular tag will be removed.
      • Facelet repeat Tag
        This tag is used to iterate over the list of items. The name of list of items is specified by the EL expression in the value attribute of this tag. This tag contains two attributes "value" "name".
    • JSF Installation
      In this section, we will learn about installation of JSF 1.1 to TOMCAT 5.5.23. Java Server Faces (JSF) requires some steps to follow while configuring it in TOMCAT.
    • Simple JSF Hello Application
      This is a simple JSF application that enables even a novice to understand easily the steps to follow to create own JSF application.
    • Download And Install SimpleHello Application
      In the last section we explained how you can develop "SimpleHelloByEnteringName" JSF example. In this, we will show you how you can quickly download and install the source code of the application provided by us.
    • JSF Navigation Example
      Navigation means connected component and it's events each-another. This section illustrates you about the JSF navigation by providing the example with the complete code of the program.
    • JSF Static Navigation Example
      This is a part of navigation in which one page is navigated to others. This section gives you something about the JSF Static navigation which makes the direct navigation between two or more pages.
    • JSF Global Navigation Example
      This is a part of navigation in which one page is navigated to others. This section gives you something about the JSF Global navigation which makes the direct navigation between two or more pages.
    • JSF Search Application Using Ajax
      Here, Roseindia Tutorial Section provides you a JSF search application using Ajax.
    • Custom Converter Example
      This section explains creating custom converter. When the user inputs value to the component, it is simple string value. Now you may be in the need of using this value as a different object like Boolean, Date etc.
    • Managing Bean Example
      This section describes you the use of the managed bean in an JSF application. In an JSF application, backing beans (managed beans) are used that can be associated with UI components.
    • JSF Simple Login Application
      This is the login application in which you will get the complete login facilities whatever should be in a web based application for protecting the page or the website accessibility.
    • JSF Remember Me Login Application
      JSF Login Application for always remember your user name and password on your PC.
    • JSF Validation In Login Application
      This section gives you the best approach for the login application. You have learnt about the login application without validating the application. But in this section you will learn how to validate a form in JSF using it's tags.
    • Integrating Login And Registration Application In JSF
      This tutorial explains integration of login and registration modules into one application. In this application, if the user is valid then it enters successfully otherwise the user is asked to get registered.
    • Enabling and Disabling Button In JSF
      In this tutorial enabling and disabling a button on different conditions has been explained. A button can be disabled setting "disabled" attribute of the commandButton tag to "true".
    • RichFaces: Login & Registration Application:
      Login and Registration is one of the most required module of any project. This tutorial explains how to implement login and registration functionality in your JSF project. The example application in this tutorial is named "RichLRApplication" which uses RichFaces as JSF implementation and library of rich featured components.

      Apache MyFaces JSF Implementation
      JSF provides rich set of components that makes easy and fast to create GUI for web application. JSF is a specification that has been implemented by many venders like Apache, Sun, Oracle etc. Because of several implementations you may not decide which implementation to use.JSF implementations also provides many components and many third party component vendors are available to use components provided by them. Among these many implementations Apache MyFaces implementation provides a lot of components that are typically needed in creating web forms. You would not require to create your own component. Tomahawk is a set of some new and standard components with extended functionality.

      Integrating MyFaces , Spring and Hibernate
      Tutorial presented here discusses the steps to configure Hibernate, Spring and MyFaces to use MySQL Database to build real world User registration and login application.

      Quick JSF Tutorial

      JavaServer Faces or JSF is great technology for the development of user interfaces for web applications. The Java Server Faces specification is defined by JSR 127 of the Java Community Process.

      source: roseindia.net