Home / Interview / JSF :: General Questions

Interview :: JSF

41) How to validate managed bean in JSF (JavaServer Faces)?

JSF provides validation constraints for bean model in the form of annotations. You can place those annotations on a field, method, or class of a JavaBeans component, such as a managed bean.

42) What are the standard converters in JSF (JavaServer Faces)?

The JavaServer Faces provides a set of Converters. You can use that to convert component data. The purpose of conversion is to take the String-based data from the Servlet API and convert it to strongly typed Java objects.

43) What is f:converter tag in JSF (JavaServer Faces)?

It is a core converter tag. It is used to add an arbitrary converter to the parent component.

44) What is f:convertDateTime tag in JSF (JavaServer Faces)?

It is used to convert user input into the specified date. You can convert a component's data to a java.util.Date by nesting the convertDateTime tag inside the component tag. The convertDateTime tag has several attributes that allow you to specify the format and type of the data.

45) What is f:convertNumber tag in JSF (JavaServer Faces)?

It is used to convert component (user input) data into a Java Number type. You can convert a component's data to a java.lang.Number by nesting the convertNumber tag inside the component tag. The convertNumber tag has several attributes that allow you to specify the format and type of the data.

46) How to refer bean method in JSF (JavaServer Faces)?

We refer a managed bean method that performs navigation processing for the component and returns a logical outcome String.

47) What is Facelets?

It is a lightweight page declaration language which is used to build JavaServer Faces views using HTML style.

48) What are the advantages of Facelets?

1) It supports code reusability through templating and composite components.

2) It provides functional extensibility of components and other server-side objects through customization

49) What is the lifecycle of Facelets application in JSF (JavaServer Faces)?

The JavaServer Faces specification defines the lifecycle of a JavaServer Faces application. The following steps describe that process to a Facelets-based application.

1) Lifecycle starts when a client makes a new request for a web page which is created using Facelets. JSF creates a new component tree or javax.faces.component.UIViewRoot and placed into the FacesContext.

50) How to create a Fecelet view?

Facelets views are XHTML pages. You can create a web page or view, by adding components to the page, wire the components to backing bean values and properties, and register converters, validators, or listeners on the components.