JSF Interview Questions

Explain the meaning of components in JSF and what are the different types?

Components in JSF 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.

The different components in JSF are elements like text box, button, table etc. that are used to create user interfaces of JSF Applications.

Once you have created a component, it’s simple to drop that component onto any JSP. Components in JSF are of two types :
Simple Components like text box, button and 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.

When is automatic conversion supplied by JSF Implementation?

JSF implementation automatically converts component data between presentation view and model when the bean property associated with the component is of one of the types supported by the component’s data.

For example, If a UISelectBoolean component is associated with a bean property of type Boolean, then JSF implementation will automatically convert the data from String to Boolean.

READ  JSF FacesServlet and FacesContext

What do you mean by a ‘Render Kit’ in JSF?

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.

Explain the way by which you can declare the Navigation Rules for JSF?

The Navigation rules indicate the JSF implementation to decide which page to navigate to after a certain action has been done on the browser like a form submission, etc.

The following example shows the usage of the navigation rules:



from-outcome should match with action attribute of the command button of the login.jsp:

Secondly, it should also match with the navigation rule in face-config.xml as


In the UI component, to be declared / used as:

Explain the way by which the components of JSF are rendered?

JSF libraries need to be added in an application.
On the .jsp page, a tag library needs to be added:

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

In an XML style:

The JSF components can be accessed using the prefix attached.
In an IDE, JSF can be added easily. However, when working without them the faces-config.xml needs to be updated and populated with classes i.e. Managed Beans between the following tags


What do you mean by rendering of page in JSF?

Every JSF page as described has various components made with the help of JSF library. JSF may contain h:form, h:inputText, h:commandButton, etc. Each of these is rendered (translated) to HTML output. This process is called encoding. The encoding procedure also assigns each component with a unique ID assigned by framework. The ID generated is random.

We believe that these interview questions and answers have really helped to improve your knowledge on JSF technology and will help you for for job interviews.