View RSS Feed

JSF

Java Server Faces (JSF) tutorials and examples.

  1. Built-in JSF validation components

    by
    JSF
    , 07-07-2012 at 05:00 PM
    JSF reference implementation of SUN gives certain defaulting validation components which are leveraged so that user input validation could be implemented. Core library of JSF provides tags so that input could be validated. Few tags are given here which are used for validation of the input.

    • f:validateDoubleRange: Component value is checked by this tag, within range. It is necessary for value to be convertiable to floating point or floating point type.


    • f:validateLength:
    ...
  2. JSF validator Tag

    by
    JSF
    , 07-07-2012 at 04:57 PM
    This tag registers as well as adds the validator to that parent component which is nearest. Typically, all of the applications present would be requiring filling some information at the page. Therefore it is considered to be a better thing to get invalid info value or formatting so that to make it “user-friendly”. Hence faults could be found out and corrected. Built in rules of validation are provided by JSF. JSF also customized the rules of validation so that to make them according to the requirements. ...
    Categories
    Validator
  3. JSF Event Listeners

    by
    JSF
    , 07-07-2012 at 04:56 PM
    When a link or button is clicked by a user, values present in a field get changed or a selection is made in list so that the application might react. Interface components of JSF User would signal certain user action when an event is fired that is being handled by the code.

    Event listeners that are very commonly used are value change and action. Others like phase or data model would not be discussed over here. In separate listener or managed bean, it is possible to declare the listeners. ...
    Categories
    Event
  4. JSF Action Events

    by
    JSF
    , 07-07-2012 at 04:54 PM
    For UI Command objects, emission of the action events takes place. When Command button is pressed by a user or a hyper link is clicked, generation of such events take place. Number of listeners could be attached to the source. For instance, let us consider the given code:

    Java Code:
    <h:commandButton value = "Test Action Listener"
    actionListener = "#{testActionListener.doSomeAction}" />
    An attribute known as actionListener is defined ...
    Categories
    Event
  5. JSF Event Classes

    by
    JSF
    , 07-07-2012 at 04:52 PM
    Interfaces which are related with JSF events are present in package'javax.faces.event'. All Events present in JSF shall be extending the javax.faces.event.FacesEvent. This class’s constructor has argument UIComponent that would be making it specific that this Event is for which UI component.

    Java Code:
    UIComponent someComponent = new UIComponent();
    MyFacesEvent event = new MyFacesEvent(someComponent);
    UIComponent sourceCompoenent = event.getComponent();
    ...
    Categories
    Event
  6. Handling Events in JSF

    by
    JSF
    , 07-07-2012 at 04:51 PM
    JSF event model is basically based upon the Event driven programming of Java that is available typically just along with the GUI applications. In case you have familiarity to the swing programming, this could be understood easily the event handling models present in JSF framework. Concept present behind this event model is that user interfaced objects have a listerner’s list. Such listeners get notified when an event is generated by the user interface objects. This shows that when a component is ...
    Categories
    Event
  7. Architecture of JSF Framework

    by
    JSF
    , 07-07-2012 at 04:50 PM
    Name:  1.jpg
Views: 668
Size:  28.3 KB

    Architecture of JSF Framework

    Framework of the JavaServer Faces is created at the MVC designed patterns. Basic advantage to use the MVS is to make separation b/w view tier and Model tier so that it could be made possible to do the extensions of the capabilities and also to do integration with some other frameworks, without any disturbance.

    Faces Servlet handles the communication that takes place b/w view tier and model. ...
  8. What is Java Server Faces(JSF) framework?

    by
    JSF
    , 07-07-2012 at 04:48 PM
    JSF is considered to be the application framework which creates the user interface. If you know about struts and swing then consider the JavaServer Faces to be the two framwork’s combination. Just like Struts, web app lifecycle management would be provided by JSF via controller servlet. And just like Swing, a rich “component model” is provided by the JSF along with component rendering and event handling.

    Web application development is eased by JSF because:

    • Allows
    ...
    Categories
    Frameworks
  9. JSF Life Cycle

    by
    JSF
    , 07-07-2012 at 04:47 PM
    JSF web application’s life cycle takes its start when a request is made by a user. When a page is submitted various other tasks would be performed, for example data validation given in the components, conversion of data etc. Therefore various steps are present which are followed by an application which is known to be the life cycle.

    Name:  1.jpg
Views: 625
Size:  59.3 KB

    JSF Life Cycle

    1. Restore view phase:
    When a JSF page is requested by a user by clicking ...
    Categories
    Tutorial
  10. JSF Architecture

    by
    JSF
    , 07-07-2012 at 04:45 PM
    When integration of the MVC designed pattern was done to create JSF so that greatly maintainable applications could be designed. For understanding of these facts, it is required to have the understanding that what is MVC pattern or how it assists in application designing so very well and how one could be making an application easily maintainable.

    An application design is split into 3 parts, by the help of MVC design pattern.

    Model : Model handles logic and data. ...
    Categories
    Tutorial
  11. JSF Components

    by
    JSF
    , 07-07-2012 at 04:44 PM
    Components present in JSF are elements, for example buttons, table, text box etc. which could be used for creation of UI of the applications of JSF. Such objects manage the user interaction. One may be creating:

    1. Simple components, for example button, text box and
    2. Compound components, like data grid, table etc.

    Various components that are present in a component is referred as a compound component. Developers are assisted by the components to make UIs when ...
    Categories
    Tutorial
  12. JSF Features

    by
    JSF
    , 07-07-2012 at 04:42 PM
    JSF is a framework that is considered to be very rich featured in Java technologies. Standard features that are provided by JSF which would be making it a standard and powerful thing among other technologies to develop the web applications. Few features are here so that this statement could be justified.

    1. JSF is considered to be a standardized web user interface framework, for Java.
    2. Developed at the Servlet API top.
    3. JSF is basically a component framework
    ...
    Tags: jsf features Add / Edit Tags
    Categories
    Tutorial
  13. What is JSF?

    by
    JSF
    , 07-07-2012 at 04:41 PM
    JSF is basically a new kind of standard framework that has been developed via JCP which makes it an easy task to make user interfaces, for web applications. This is usually done when reusable components which are present in a page are assembled. One might be thinking a JSF framework to be a toolbox which has ready-to-use components so that such components might be used multiple times for adding and reusing them. Therefore, JSF applications are considered to be event driven. Typically, you can embed ...
    Tags: what is jsf? Add / Edit Tags
    Categories
    Tutorial
  14. Why JSF?

    by
    JSF
    , 07-07-2012 at 04:35 PM
    First it shall be understood that what the reasons which initiate the JSF projects are. Why JSF has been considered to be very hot today? Reasons are there to develop the new frameworks rather than other many present already like Struts, JSP and Servlets. If a complexed web application has been developed in JSP, then this shall be kept in mind that certain complexities would be related.List of few problems related with certain technologies are given as following:

    • Tedious and repetitive
    ...
    Tags: why jsf? Add / Edit Tags
    Categories
    Tutorial
  15. JSF Disadvantages

    by
    JSF
    , 01-02-2012 at 06:58 PM
    Following are the main disadvantages of JSF framework.
    • When retrieving data from database and rendering it using JSF table component, it has performance issues.
    • Managed bean and phase listener has no strong coupling.
    • Error messages that are displayed by default are not good.
    • It is not scalable. Session object is used to store the component state.
    Categories
    Tutorial
  16. JSF Life Cycle

    by
    JSF
    , 01-02-2012 at 06:57 PM
    The JSF contains the following six phases as shown in figure as well.
    • Restore View Phase: It is used to retrieves the component tree.
    • Render Response Phase: When page is displayed first time and it has no query data, this phase is called.
    • Apply Request Values Phase: Object values are checked and applied in this phase.
    • Process Validations Phase: All the value validators are applied in this phase.
    • Update Model Phase: In this phase local values are updated ...
    Categories
    Tutorial
  17. JSF Method Binding

    by
    JSF
    , 01-02-2012 at 06:54 PM
    JSF method binding does not represent an accessor method like a value binding. An activation method is represented by this method binding. Following code shows an event handler to a method.

    Java Code: JSF action listener
    <h:commandButton ……
    actionListener=“#{customer.loginActionListener}”
    ……… />

    Updated 01-14-2012 at 06:32 PM by JSF

    Categories
    Binding
  18. JSF Value Binding

    by
    JSF
    , 01-02-2012 at 06:52 PM
    JSF components uses JSF value binding expressions to support following:

    • Instantiate a bean and store it in request or session scope.
    • Java bean value is overridden
    • Map, List and array contents are retrieved quickly.
    • In a number of requests, content is synchronized.
    Categories
    Binding
  19. JSF Managed Bean

    by
    JSF
    , 01-02-2012 at 06:51 PM
    JSF managed beans are defined in configuration file and these are java beans to hold data from JSF components. They represent data model and are passed between JSF business logic and JSF pages.

    Following are the main features of managed beans.
    • They use declarative model
    • They provide an entry point
    • Beans with various states

    Following code shows a managed bean which has a session scope. Instance of this managed bean is created at the start ...

    Updated 01-14-2012 at 06:30 PM by JSF

    Categories
    Managed Bean
  20. JSF Validators

    by
    JSF
    , 01-02-2012 at 06:49 PM
    JSF validators are used to support input validation and save lot of time of programmers in writing custom validation methods. JSF contains a large set of validator classes. Following are the some of built-in validators.

    • DoubleRangeValidator: Any numeric type, between specified maximum and minimum values
    • LongRangeValidator: Any numeric type convertible to long, between specified maximum and minimum values
    • LengthValidator: Ensures that the length of a component's ...
    Categories
    Validator
  21. JSF Events Handling

    by
    JSF
    , 01-02-2012 at 06:48 PM
    JSF components trigger events and these events are process by the JSF application. User generates these events by interacting with the application. For example, Click a button event is generated and triggered by the user. Programmer is responsible to handle all such events in code. You can write event listeners for this purpose.

    Following JSF code is written to create a button.

    Java Code: This is example of a JSF Button
    <h:commandButton value="Login“
    actionListener=“#{customer.loginActionListener}”
    ...

    Updated 01-14-2012 at 06:28 PM by JSF

    Categories
    Event
  22. JSF vs Struts Framework

    by
    JSF
    , 01-02-2012 at 06:45 PM
    Folowing points explain the key differences between these 2 frameworks.

    • Struts framework is matured and evolved over the years.
    • JSF is immature as compare to Struts.
    • Struts is based on a controller which uses Front Controller design pattern. Also it has only one event handler for a HTTP request.
    • JSF is based on Page Controller design pattern and front controller Servlet handles all requests.
    • Struts does not support RAD.
    • Struts supports ...
    Tags: jsf, struts Add / Edit Tags
    Categories
    Tutorial , Frameworks
  23. JSF Framework

    by
    JSF
    , 01-02-2012 at 06:44 PM
    Recently, Java Server Faces has gained lot of popularity for building web applications in java. Following are the core features of java server faces.

    • It supports rapid application development with help of its core components like buttons, text fields, tree, tables etc. Programmer can build their applications using these components.
    • It has a support for JSP tags to access its interface components as explained in above step. Also it supports custom components.
    • It ...
    Categories
    Tutorial