×

Top 30 JSF Interview Questions for 2024

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.

Related Topics

Top 25 jQuery Interview Questions for 2024

Most Frequently asked jQuery Interview Questions and Answers for Fresher and Experienced 1) Define Find and Children Method? In DOM tree if you have to find all the method we use Find...

4 minutes read.

Top 30 SQL Interview Questions for 2024

1. What is SQL? Ans. SQL stands for Structured Query Language.  It is a standard computer language for accessing, storing, and manipulating data stored in the relational database. SQL become an International Standard Organization (ISO)...

11 minutes read.

Top 20 C Programming | Coding Interview Questions for 2024

Most Frequently asked C programming | Coding Interview Questions and answer for Fresher C is a powerful high-level programming language.  It is a fast, portable and available for all platforms. C...

15 minutes read.

W3.CSS Interview Questions

1) What is W3.CSS? W3.CSS stands for Cascading Style Sheet. It is developed by w3schools.com. It is used to create faster, beautiful and responsive websites. 2) What are the features of W3.CSS? W3.CSS...

3 minutes read.

Top 29 Pascal Interview Questions for 2024

1) What is Pascal? Pascal is a high-level and Algol-based language that was developed by Niklaus Wirth. It is used to develop efficient and reliable programs. 2) What are the features of Pascal? Features...

4 minutes read.

Top 30 CSS Interview Questions for 2024

1) Define the process where block elements can be centered with css. It can be centered by using margin-left and margin-right properties we can centered the block level elements. 2) Name the...

4 minutes read.

Top 25 R programming Language Interview Questions for 2024

1) What is R programming language? R is an open source programming language. It is software environment for statistical computing and graphics. It compiles and runs on a wide variety of...

4 minutes read.

Top 29 Phalcon Framework Interview Questions for 2024

1) What is Phalcon? Phalcon is an open source framework based on the MVC (Model-View-Controller) pattern. It is the combination of PHP and C language. It is developed by Andres Gutierrez...

6 minutes read.

Top 10 Java Swing Interview Questions for 2024

1) What is Java Swing? It is a part of JFC (Java Foundation Classess) that is used to create window-based applications. Java Swing components are platform independent and lightweight . 2) What is...

3 minutes read.

Top 15 Erlang Interview Questions for 2024

1) What is Erlang÷ Erlang is an open source programming language. It is used to build massively scalable soft real-time systems. It has runtime environment. It supports concurrency, fault tolerance and...

2 minutes read.

Top 30 WordPress Interview Questions for 2024

Most Frequently asked WordPress Interview Questions and Answers 2019 1) What is WordPress? WordPress is an open-source CMS (Content Management System) and a blogging tool. It is used to create web sites and...

5 minutes read.

Top 15 ExpressJS Interview Questions for 2024

1) What is ExpressJs? Express Js is a framework for node.js which is light-weight and fast. It is used to develop web and mobile applications. 2) What are the features of ExpressJs? Following...

4 minutes read.

Top 15 CherryPy Interview Questions for 2024

1) What is CherryPy? CherryPy is a web framework used for Python. It provides a friendly interface for Http protocol for Python developer. 2) Why we use CherryPy? CherryPy has following strength: Simplicity: It...

3 minutes read.

Top 25 CoffeeScript Interview Questions for 2024

1) What is CoffeeScript? It is a language that compiles into JavaScript. CoffeeScript is an attempt to expose good parts of JavaScript so, that user can code more easily. 2) Name the...

3 minutes read.

Top 50 HTML Interview Questions for 2024

1) What is HTML? HTML stands for Hyper Text Markup Language. It is used for creating web pages and web applications. HTML documents are made up of two things: the content and the tags. 2) What are...

10 minutes read.

Top 15 RESTful Web Services Interview Question for 2024

1) What is REST? REST is web standards based architecture and stands for REpresentational State Transfer. It uses HTTP Protocol for data communication. Here, everything is a resource. 2) What are the HTTP methods used...

2 minutes read.

Top 16 Moo Tools Interview Questions for 2024

1) What is Moo Tools? MooTools stands for My Object-Oriented Tools. It is a lightweight and object-oriented JavaScript framework. It is used to create dynamic web page. It is developed by Valerio...

5 minutes read.

Top 15 Apache Tapestry Interview Questions for 2024

1) What is Apache Tapestry? It is an open source web framework written in Java and can work under any application server. It is easily integrate with back ends like Hibernate...

2 minutes read.

Top 28 LISP Interview Questions for 2024

1) What is LISP? LISP is the high-level programming language after Fortran. LISP is stands for List Processing. This programming language was invented by John McCarthy in 1958 at the Massachusetts Institute of...

3 minutes read.

Top 18 UiPath Interview Questions for 2024

RPA UiPath Interview Questions and Answers for Fresher  1. What is RPA? RPA is an acronym for Robotic Process Automation. Robotic In RPA, Robotic is termed as an entity or machine which tries to...

7 minutes read.