Latest JSF Interview Questions and Answers

Read Top JSF Interview Questions and Answers Experienced, Freshers for Job Interview Quiz with Solutions.

What does JSF-Managed Bean?

Managed bean in JSF act as a Model for UI component, it can be accessed from JSF page.  The managed bean consists of the “getter” and “setter” techniques, business logic or even a backing bean.

What Ajax is and how JSF is useful for making AJAX call?

Ajax is a method to use HTTPXMLObject of JavaScript to direct data to server and receive data from server simultaneously. Using Ajax, javascript code exchanges data with server, updates parts of webpages without reloading the whole page. For making Ajax call JSF provides full support. It provides f:ajax tag to handle ajax calls.

Mention what is the difference between JSF and Struts?

JSF Struts

  • JSF is a specification

  • JSF action methods can be applied in Java objects

  • JSF has event model which reacts on actions, value changes and phase changes in JSF lifecycle

  • JSF component tag does not produce HTML-instead they declare a component renderer pair on the server

  • By mentioning a navigation rule in the faces configuration file, JSF supports navigation

  • JSF uses dependencies injection

  •  Struts is an open source framework

  • Struts actions are restricted to struts API only

  • There are no such event models in struts

  • Struts tag generates HTML directly

  • To define navigation struts uses the notation

  • There is no dependencies injection in struts

How you can call multiple listeners in JSF?

To call multiple listeners in JSF, there is a JSF tag for “value change listeners” and one for “action listeners” that can be availed to link one or more than one listeners to an element.  While using the tag syntax, you will be declaring a class that implements a listener interface.  For value change listener tag is <f:valueChangeListener> and for action listeners tag is <f:actionListener>.

What are converter tags in JSF?

JSF has inbuilt convertors to convert or change its UI components data to object used in a managed bean and vice versa. These tags can convert text into date object and can validate the format of the input as well.

List out the converter tags used in JSF?

Converter tags used in JSF are

  • convertNumber: It converts a string into a number of desired format

  • convertDateTime: It converts a string into a date of desired format

  • Custom Converter: It creates a custom converter

What are facelets JSF tags?

Facelets JSF tags are special tags to create common layout for a web application referred as facelet tags. To manage common parts of a multiple pages at one place, facelets tags are used.


Popular posts from this blog

TOP Agile Testing Interview Questions and Answers

Latest Agile Testing Interview Questions and Answers

Most Asked ADO.NET Interview Questions and Answers