JSF Interview Questions & Answers

  • Share this blog:

What is JSF (JavaServer Faces)?

It is a server side segment based UI structure. It is used to create web applications. It gives a very much characterized programming model and comprises of rich API and applications. The latest version JSF 2 uses Facelets as its default templating system.

How does execution phase work in JSF (JavaServer Faces) lifecyle?

In execute phase, when first request is made, application view is built or restored. For other subsequent requests other actions are performed like request parameter values are applied, conversions and validations are performed for component values, managed beans are updated with component values and application logic is invoked.

What is Render Kit in JSF?

Segment classes for the most part exchange the undertaking of producing yield to the renderer. All JSF parts tail it. Render pack is an arrangement of related renderers. javax.faces.render.RenderKit is the class which speaks to the render pack. The default render pack contains renderers for html however it’s up to you to make it for other markup dialects. Render unit can execute a skin (a look and feel). Render unit can focus on a particular gadget like telephone, PC or markup dialect like HTML, WML, SVG. This is extraordinary compared to other advantage of JSF in light of the fact that JSF doesn't utmost to any gadget or markup.

How to make custom tag in JSF?

JSF custom label illustration:

JSF gives the office to make custom tag to render a pre-characterized content. A JSF custom label utilizes "ui:composition" to embed content into the page.

Steps to create the JSF custom tag:

1. In the first place make a predefined content in a XHTML page with ui:compisition tag.

2. Announces and characterize the custom label subtle elements in a label library descriptor.

3. Enlist the label library descriptor in the web.xml document.

What are different JSF validator tags?

JSF validator tags:

JSF provides inbuilt validators to validate the UI component data. JSF validators can validates length, type, format etc.

For using JSF validator tags we have to use the following namespaces of URI in html node.

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core"

What is supporting bean?

JSF backing bean is an overseen bean which contains a few or all estimations of a web frame. It is ordinarily for business rationale.

What is JavaServer Faces validation model? 

A mechanism for validating the data a user inputs to a JavaServer Faces UI component.

What is JavaServer Faces navigation model?

A mechanism for defining the sequence in which pages in a JavaServer Faces application are displayed.

What is JavaServer Faces conversion model? 

A mechanism for converting between string-based markup generated by JavaServer Faces UI components and server-side Java objects.

What are contrasts amongst swaggers and JSF?

In a nutshell, Faces has the following advantages over Struts:

Disposed of the requirement for a Form Bean

Disposed of the requirement for a DTO Class

Permits the utilization of the same POJO on all Tiers as a result of the Backing Bean

What regular JSF application comprises of?

A regular JSF application comprises of the accompanying parts:

-JavaBeans segments for overseeing application state and conduct.

-Occasion driven improvement (through audience members as in customary GUI advancement).

-Pages that speak to MVC-style sees; pages reference see roots by means of the JSF part tree.

What if no navigation rule matches a given action?

If no navigation rule matches a given action, then the current page is redisplayed.

Explain life-cycle Phases of JSF?

Restore View : A request comes through the FacesServlet controller. The controller examines the request and extracts the view ID, which is determined by the name of the JSP page.

Apply request values: The purpose of the apply request values phase is for each component to retrieve its current state. The components must first be retrieved or created from the FacesContext object, followed by their values.

Process validations: In this phase, each component will have its values validated against the application's validation rules.

Update model values: In this phase JSF updates the actual values of the server-side model ,by updating the properties of your backing beans.

Invoke application: In this phase the JSF controller invokes the application to handle Form submissions.

Render response: In this phase JSF displays the view with all of its components in their current state.

You liked the article?

Like : 0

Vote for difficulty

Current difficulty (Avg): Medium

Recommended Courses


About Author
Author Bio

TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills in the market.

Stay Updated

Get stories of change makers and innovators from the startup ecosystem in your inbox