Interview Questions

AJAX Interview Questions Android Interview Questions Angular 2 Interview Questions AngularJs Interview Questions Apache Presto Interview Questions Apache Tapestry Interview Questions Arduino Interview Questions ASP.NET MVC Interview Questions Aurelia Interview Questions AWS Interview Questions Blockchain Interview Questions Bootstrap Interview Questions C Interview Questions C Programming Coding Interview Questions C# Interview Questions Cakephp Interview Questions Cassandra Interview Questions CherryPy Interview Questions Clojure Interview Questions Cobol Interview Questions CodeIgniter interview Questions CoffeeScript Interview Questions Cordova Interview Questions CouchDB interview questions CSS Buttons Interview Questions CSS Interview Questions D Programming Language Interview Questions Dart Programming Language Interview Questions Data structure & Algorithm Interview Questions DB2 Interview Questions DBMS Interview Questions Django Interview Questions Docker Interview Questions DOJO Interview Questions Drupal Interview Questions Electron Interview Questions Elixir Interview Questions Erlang Interview Questions ES6 Interview Questions and Answers Euphoria Interview Questions ExpressJS Interview Questions Ext Js Interview Questions Firebase Interview Questions Flask Interview Questions Flex Interview Questions Fortran Interview Questions Foundation Interview Questions Framework7 Interview Questions FuelPHP Framework Interview Questions Go Programming Language Interview Questions Google Maps Interview Questions Groovy interview Questions GWT Interview Questions Hadoop Interview Questions Haskell Interview Questions Highcharts Interview Questions HTML Interview Questions HTTP Interview Questions Ionic Interview Questions iOS Interview Questions IoT Interview Questions Java BeanUtils Interview Questions Java Collections Interview Questions Java Interview Questions Java JDBC Interview Questions Java Multithreading Interview Questions Java OOPS Interview Questions Java Programming Coding Interview Questions Java Swing Interview Questions JavaFX Interview Questions JavaScript Interview Questions JCL (Job Control Language) Interview Questions Joomla Interview Questions jQuery Interview Questions js Interview Questions JSF Interview Questions JSP Interview Questions KnockoutJS Interview Questions Koa Interview Questions Laravel Interview Questions Less Interview Questions LISP Interview Questions Magento Interview Questions MariaDB Interview Questions Material Design Lite Interview Questions Materialize CSS Framework Interview Questions MathML Interview Questions MATLAB Interview Questions Meteor Interview Questions MongoDB interview Questions Moo Tools Interview Questions MySQL Interview Questions NodeJS Interview Questions OpenStack Interview Questions Oracle DBA Interview Questions Pascal Interview Questions Perl interview questions Phalcon Framework Interview Questions PhantomJS Interview Questions PhoneGap Interview Questions Php Interview Questions PL/SQL Interview Questions PostgreSQL Interview Questions PouchDB Interview Questions Prototype Interview Questions Pure CSS Interview Questions Python Interview Questions R programming Language Interview Questions React Native Interview Questions ReactJS Interview Questions RequireJs Interview Questions RESTful Web Services Interview Questions RPA Interview Questions Ruby on Rails Interview Questions SAS Interview Questions SASS Interview Questions Scala Interview Questions Sencha Touch Interview Questions SEO Interview Questions Servlet Interview Questions SQL Interview Questions SQL Server Interview Questions SQLite Interview Questions Struts Interview Questions SVG Interview Questions Swift Interview Questions Symfony PHP Framework Interview Questions T-SQL(Transact-SQL) Interview Questions TurboGears Framework Interview Questions TypeScript Interview Questions UiPath Interview Questions VB Script Interview Questions VBA Interview Questions WCF Interview Questions Web icon Interview Questions Web Service Interview Questions Web2py Framework Interview Questions WebGL Interview Questions Website Development Interview Questions WordPress Interview Questions Xamarin Interview Questions XHTML Interview Questions XML Interview Questions XSL Interview Questions Yii PHP Framework Interview Questions Zend Framework Interview Questions Network Architect Interview Questions

Top 30 JSF Interview Questions for 2022

1) What is JSF?

JSF stands for Java Server Faces is a Java-Based web application framework. JSF (Java Server Faces) provides a facility to connect UI widgets with data sources.

2) What are the benefits of JSF?

Benefits of JSF are:
  • Reusable UI components
  • Easy data transfer between UI components
  • Enable implementation of custom components
  • Manage UI state across multiple server requests

3) What is MVC Design Pattern?

It is used to design an application using three separate modules. Modules are:
  • Model
  • View
  • Controller

4) What are the phases of JSF life cycle?

Phases of JSF life cycle are:
  • Restore view phase
  • Apply request values phase
  • Process validations phase
  • Update model values phase
  • Invoke application phase
  • Render response phase

5) What are the types of Converter Tags used in JSF?

There are three types of converter tags used in JSF are:
  • f:convertNumber
  • f:convertDateTime
  • Custom Convertor

6) What are the types of Validator Tags used in JSF?

Types of Validator tags are:
  • f:validateLength
  • f:validateLongRange
  • f:validateDoubleRange
  • f:validateRegex
  • Custom Validator

7) What are the types of Event Handlers used in JSF?

There are three types of Event Handlers in JSF:
  • actionListener
  • Application Events
  • valueChangeListener

8) What are the advantages of JSF Expression language?

Advantages of JSF Expression language are:
  • It provides easy access to elements
  • It provides Automatic type conversion
  • It provides easy access to predefined objects
  • Instead of NullPointerException, It shows missing values as empty strings
  • By using expression language(Arithmetic, relational and logical operations can be done)

9) What is Managed Bean in JSF?

It is a Java Bean class registered with JSF. Here, Java bean class are managed by JSF framework. It works as Model for UI component and accessed from JSF page.

10) What is h:inputSecret tag in JSF?

h:inputSecret tag: It is used to create a HTML password fields. It accepts one line of text with no spaces.

11) What is the difference between JSF and Struts?

Difference between JSF and Struts are:
JSF Struts
It is a specification It is an open source framework
Here, Action methods can be applied in Java objects Here, Struts actions are restricted to struts API only
Here, Component tag does not produce HTML Here, Struts tag generates HTML directly
It supports navigation Struts uses the notation to define navigation
Uses dependencies injection Not uses dependencies injection

12) Which tag is used to display error messages in JSF?

By using h:messages tag, you can display error messages in JSF.

13) What is the difference between JSF-1 and JSF-2?

Difference between JSF-1 and JSF-2 are:
JSF-1 JSF-2
It does not support annotations It supports annotations
Here, Ajax support was limited It supports all the Ajax features
Does not provide Template concepts Provide Template concepts

14) What are the important basic tags used in JSF?

Important basic tags used in JSF are:
h:inputText h:inputSecret h:selectOneMenu h:commandLink
h:inputTextarea h:inputHidden h:outputStylesheet h:outputLink
h:selectBooleanCheckbox h:selectManyCheckbox h:outputScript h:panelGrid
h:selectOneRadio h:outputText h:commandButton h:message
h:selectOneListbox h:outputFormat h:Link h:messages
h:selectManyListbox h:graphicImage f:attribute f:attribute

15) h:inputSecret field becomes empty when page is reloaded. How to fix this?

Set redisplay=true (By default it is false).

16) What is the use of @ManagedProperty annotation in JSF?

@ManagedProperty annotation: This property is used to transfer or inject a managed bean's property in another managed bean.

17) What is eager?

eager: It is an attribute that is used to create managed bean. If eager = "true", then managed bean is created before it is requested for the first time.

18) What is lazy initialization in JSF?

lazy initialization: It is used to create managed bean but only when it is requested.

19) Can we access Managed Bean from JSF Page?

Yes, We can access Managed Bean from JSF Page.

20) What are the Scope Annotations available in JSF?

The Scope Annotations available in JSF are:
  • @NoneScoped
  • @ViewScoped
  • @CustomScoped
  • @SessionScoped
  • @RequestScoped
  • @ApplicationScoped

21) What is Implicit Navigation?

Implicit Navigation: It is an auto view page resolver mechanism which is provided by JSF. In Implicit Navigation, you only need to put view name in action attribute and JSF will search the correct view page automatically in the deployed application.

22) What is the use of f:attribute in JSF?

f:attribute: This tag is used to pass attribute to a JSF UI Component.

23) What is the use of f:param in JSF?

f:param: This tag is used to pass parameters to a JSF UI Component.

24) What is facelets tag?

facelets tag: This is a special tag that is used to create common layout for a web application. Facelets tag provides flexibility to manage common parts of multiple pages at one place.

25) What is the use of Convertor Tags in JSF?

Convertor Tags: These tags are used to convert JSF UI component’s data to object in a managed bean. For example, Convertor tags are used to convert a text into date object and can validate the format of input as well.

26) What is DataTable in JSF?

DataTable: It is used to iterate over a collection or array of values to display data. DataTable also provides attributes to modify its data in an easy way.

27) What are the Composite Tags available in JSF?

The Composite Tags available in JSF are:
  • composite:interface
  • composite:attribute
  • composite:implementation

28) What is DelegatingVariableResolver in JSF?

DelegatingVariableResolver: It is a class which is used to integrate JSF and Spring together in a seamless manner.

29) What is the use of composite:attribute tag in JSF?

composite:attribute: This tag is used to declare Configuration values.

30) What is h:inputTextarea tag in JSF?

h:inputTextarea: This tag is used to renders an HTML textarea element.