JSF Interview Questions

What does component mean and what are its types? Components in JSF are elements like text box, button, table etc. that are used to create user interfaces of JSF Applications. These are objects that manage interaction with a user.

JSF Interview Questions

JSF Interview Questions

        

  1. What does component mean and what are its types?
    Components in JSF are elements like text box, button, table etc. that are used to create user interfaces of JSF Applications. These are objects that manage interaction with a user. 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. Components in JSF are of two types :
    1. Simple Components like text box, button and
    2. Compound Components like table, data grid etc.

A component containing many components inside it is called a compound component.

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 box, check box, list boxe, button, label, radio button, table, panel etc. These are called standard components.

  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.
  1. What are third party components and how they are useful?
    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 . These pre-built & enhanced components can be used in UI of your web application. For example, we are in need of a stylish calendar then we have an option to take it from third party rather than creating it our own. This will help saving time & cost creating effective & robust UI and to concentrate on business logic part of web application.
  2. What are tags in JSF ?
    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 (Sun Implementation) provides 43 tags in two standard JSF tag libraries:
    1. JSF Core Tags  Library
    2. JSF Html Tags Library

    Even a very simple page uses tags from both libraries. These tags can be used adding the following lines of code at the head of the page.

    <%@ taglib uri=?http://java.sun.com/jsf/core ? prefix=?f? %> (For Core Tags)
    <%@ taglib uri=?http://java.sun.com/jsf/html ? prefix=?h? %> (For Html Tags)

  3. What is the difference between JSP and JSF?
    JSP simply provides a Page which may contain markup, embedded Java code, and tags which encapsulate more complicated logic / html.
    JSF may use JSP as its template, but provides much more. This includes validation, rich component model and lifecycle, more sophisticated EL, separation of data, navigation handling, different view technologies (instead of JSP), ability to provide more advanced features such as AJAX, etc.