×

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 30 Cobol Interview Questions for 2024

1) What is COBOL? COBOL is a programming language which is used for finance, business and administrative systems for companies. COBOL is stands for Common Business Oriented Language. 2) What are the features...

4 minutes read.

Top 30 SQLite Interview Question for 2024

1) What is SQLite? It is an in-process library which implements self-contained, serverless, zero-configuration, transactional SQL database. 2) What datatype does SQLite supports? It uses dynamic typing and data can be stored in...

5 minutes read.

Top 30 Joomla Interview Questions for 2024

1) What is Joomla? Joomla is an open source content management system. It is used to build online applications and websites. It uses model-view-controller (MVC) web application framework. It is free and easy to...

4 minutes read.

Top 30 Magento Interview Questions for 2024

1) What is Magento? Magento is an open-source content management system. It is used to create e-commerce websites. It is developed by Varien ,Inc, a US private company headquartered in Culver City, California. It...

5 minutes read.

Top 30 CodeIgniter interview Questions for 2024

1) What is CodeIgniter? CodeIgniter is an open source PHP framework. It is used to develop web applications and websites. It is loosely based on MVC pattern and easy to use...

4 minutes read.

Artificial Neural Network Interview Questions

1. Explain Neural Network?  Neural Network is a sequence of an algorithm that gives its best to recognize the underlying relationship in a data-set through a process. The artificial neural network...

8 minutes read.

Top 30 SASS Interview Questions for 2024

1) What is Sass? SASS: Systematically Awesome Style Sheets is an extension of CSS. It is also known as CSS pre-processor which helps to reduce repetition with CSS and saves time. It is...

4 minutes read.

Top 30 Ruby on Rails Interview Questions for 2024

1) What is Ruby on Rails? It is a server-side web application framework. It is an open source ruby framework which is used for developing database-backed web applications. Here, no compilation phase is...

4 minutes read.

Top 25 Oracle DBA Interview Question for 2024

1) What is an Oracle Instance? Database instance is a set of memory structures that manages database file. When an instance is started Oracle database allocate memory area called SGA (System...

4 minutes read.

VB.NET Interview Questions

1) What is VB.NET? VB.NET stands for Visual Basic .NET. It is an object oriented programming language. It is implemented on .NET framework and launched by Microsoft in 2001. 2) Who is...

3 minutes read.

Top 15 SVG Interview Questions for 2024

1) What is SVG? SVG stands for Scalable Vector Graphics, It is XML based format used to draw dimentional vector images. It is a W3C standard. SVG supports all image formats. 2) What are...

2 minutes read.

Top 15 Java BeanUtils Interview Questions for 2024

1) What is Java BeanUtils? Java BeanUtils is a design pattern component of the Apache Commons. It facilitates architecture for Java language which is derived from JavaAPI. It helps to set...

3 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 30 TurboGears Framework Interview Questions for 2024

1) What is TurboGears Framework? TurboGears is a Python Framework. It is used to create rapid web application. It consists of several WSGI (Web Server Gateway Interface) components. It is developed...

5 minutes read.

Top 15 CSS Buttons Interview Questions for 2024

1) What is CSS buttons? CSS buttons is used to create awesome button. It provides huge collection of CSS library files. 2) What are the CSS libraries to create buttons? There are following...

5 minutes read.

Top 15 Foundation Interview Questions for 2024

1) What is Foundation? Foundation is a front-end framework that is for designing beautiful responsive websites. This framework is compatible with all types of devices and provides you with HTML, CSS...

2 minutes read.

Top 15 JCL (Job Control Language) Interview Questions for 2024

1) What is JCL? JCL refers to Job Control Language. It is a command language which describes job (unit of work) for the Multiple Virtual Storage (MVS) operating system. It is...

3 minutes read.

Top 14 Materialize CSS Framework Interview Questions for 2024

1) What is Materialize? Materialize is a CSS framework that contains library file. It is created with CSS, JavaScript and HTML. It helps to create attractive, reliable and functional web pages...

7 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 15 Servlet Interview Questions for 2024

1) What is Servlet? It is a technology used to create web applications. It is a web component which is used to create dynamic web pages. It consists of many interfaces and classess...

2 minutes read.