65+ JSF Interview Questions

JSF Interview Questions

1) What is JSF (JavaServer Faces)? 

It is a server-side part based UI system. It is utilized to create web applications. It gives a very much characterized programming model and comprises of rich API and label libraries. The most recent form JSF 2 utilizes Facelets as its default templating framework.

2) What are the advantages of JSF (JavaServer Faces)? 

It gives a perfect and clear division among conduct and introduction of the web application. You can compose business rationale and UI independently.

3) What are the highlights of JSF (JavaServer Faces)? 

The most recent adaptation of JSF 2.2 gives the accompanying highlights.

Segment Based Framework

Executes Facelets Technology

Reconciliation with Expression Language

Backing HTML5

Straightforwardness and Rapid Web Development.

Bolster Internationalization

Bean Annotations

4) Give the framework prerequisites for the JSF use. 

For utilizing JSF in a PC, the stage needs JDK 1.5 or above.

5) What is the existence cycle of JSF (JavaServer Faces)? 

JavaServer Faces application structure oversees lifecycle stages naturally for straightforward applications and furthermore enables you to deal with that physically. The lifecycle of a JavaServer Faces application starts when the customer makes a HTTP demand for a page and finishes when the server reacts with the page.

6) How does the execution stage work in JSF (JavaServer Faces) life cycle? 

In the execute stage, when the main solicitation is made, the application see is manufactured or reestablished. For other resulting demands different activities are performed like solicitation parameter esteems are connected, changes and approvals are performed for segment esteems, oversaw beans are refreshed with segment esteems, and application rationale is conjured.

7) How does render stage work in JSF (JavaServer Faces) life cycle? 

In this stage, the mentioned view is rendered as a reaction to the customer program. View rendering is a procedure in which yield is produced as HTML or XHTML. Along these lines, the client can see it on the program.

8) What is overseen bean in JSF (JavaServer Faces)? 

It is an unadulterated Java class which contains a lot of properties and the arrangement of the getter, setter strategies.

Following are the normal capacities that overseen bean strategies perform:

Approving a part's information

Taking care of an occasion terminated by a segment

Performing handling to decide the following page to which the application must explore

9) How to design oversaw bean in the XML document? 

For this situation, we design bean-name, bean-class, and bean-scope in the XML document to make it available in the venture. This is a more established way to deal with arrange bean into a XML record.

10) What are the accessible extensions for the overseen bean? 

You can utilize following degrees for a bean class:

Application (@ApplicationScoped): Application scope endures crosswise over association of the considerable number of clients with the web application.

Session (@SessionScoped): Session scope perseveres over numerous HTTP demands in a web application.

View (@ViewScoped): View scope endures amid the connection of the client with a solitary page (see) of a web application.

11) What is enthusiastic overseen bean? 

The Managed bean is apathetic of course. It implies the bean is instantiated just when a solicitation is produced using the application.

You can compel a bean to be instantiated and set in the application scope when the application is begun.

12) What are User Interface Components in JSF (JavaServer Faces)? 

JavaServer Faces HTML label library speaks to HTML structure segments and other fundamental HTML components, which are utilized to show or acknowledge information from the client. A JSF structure sends this information to the server in the wake of presenting the structure.

13) What are the MVC structure modules? 

Display

View

Controller

14) Give a rundown of facelet labels.

Formats

Parameters

Custom

Evacuate

15) Give a rundown of vital DataTable activities. 

Show DataTable

Include information

Alter information

Erase information

Utilizing the information display

16) What does AJAX represent? 

AJAX represents Asynchronous JavaScript and XML.

17) List some AJAX traits. 

Impaired

Occasion

Execute

Prompt

Audience

Onerror

Onevent

Render

18) Name some essential occasion handlers. 

ActionListener

ApplicationEvents

ValueChangeListener

19) What are the necessities for utilizing incorporated JSF utilizing JDBC? 

PostgreSQLJDBC4 Driver

PostgreSQL 9.1

20) What is the utilization of Controller module? 

It handles the preparing of an application.

21) What is the utilization of the View module? 

The module demonstrates the UI.

22) What is h:inpuText tag in JSF (JavaServer Faces)? 

The JSF tag is utilized to render an information field on the site page. 

It is utilized inside a tag to announce input field that enables the client to enter information. 

23) What is h:outputText tag in JSF (JavaServer Faces)? 

The JSF is utilized to render a plain content. On the off chance that the "styleClass", "style", "dir" or "lang" characteristics are available, render a "length" component. On the off chance that the "styleClass" characteristic is available, render its incentive as the estimation of the "class" property. 

24) What is h:form tag in JSF (JavaServer Faces)? 

The tag speaks to an information structure. It incorporates tyke segments that can contain information which is either displayed to the client or submitted with the structure. It can likewise incorporate HTML markup to spread out the segments on the page. 

25) What is h:commandButton tag in JSF (JavaServer Faces)? 

The tag makes a submit catch and used to present an application structure. 

26) What is h:inputTextarea tag in JSF (JavaServer Faces)? 

The tag renders a HTML "textarea" component. It enables a client to enter multiline string. 

27) What is h:commandLink tag in JSF (JavaServer Faces)? 

JSF renders it as a HTML "a" stay component that goes about as a structure submit catch when clicked. Along these lines, you can make a stay tag by utilizing this tag. A h:commandLink label must incorporate a settled h:outputText tag, which speaks to the content that the client snaps to create the occasion. It's likewise required to be set inside a tag. 

28) What is h:inputSecret tag in JSF (JavaServer Faces)? 

It is a standard secret word field which acknowledges one line of content without any spaces and shows it as a lot of indicators as it is entered. As it were, we state, it is utilized to make a HTML secret phrase field which enables a client to include a string without the genuine string showing up in the field.

29) What is h:inputHidden tag in JSF (JavaServer Faces)? 

It renders a HTML "input" component of sort covered up. It doesn't show up on the site page, so you can pass concealed data while presenting the structure.

30) What is h:inputFile tag in JSF (JavaServer Faces)? 

JSF renders it as a HTML component of sort document. It is utilized to get the record as info. In HTML structure, it enables a client to transfer a document.

31) What is h:graphicImage tag in JSF (JavaServer Faces)? 

JSF renders a HTML component "img" tag. This tag is utilized to render a picture on the website page.

32) What is h:message tag in JSF (JavaServer Faces)? 

It is utilized to show a solitary message for a specific part. You can show your custom message by passing the id of that part into the for the property.

33) What is h:messages tag in JSF (JavaServer Faces)? 

It is utilized to shows all messages that were put away in the faces setting over the span of the JSF lifecycle.

34) What is h:dataTable tag in JSF (JavaServer Faces)? 

It is utilized to make an information table that can be refreshed progressively.

35) What are the accessible approval labels in JSF (JavaServer Faces)? 

JavaServer Faces innovation gives a lot of standard classes and related labels that you can use to approve components information. A table which contains the approval labels is given.

36) What is f:validateBean tag in JSF (JavaServer Faces)? 

It is utilized to enroll a bean validator to the part. For approving the bean display, you should set the setting parameter in the web arrangement descriptor document web.xml.

37) What is f:validateDoubleRange tag in JSF (JavaServer Faces)? 

It is utilized to watch that the estimation of an information field is inside a particular range or not. The esteem must be a buoy or twofold sort.

38) What is f:validateLength tag in JSF (JavaServer Faces)? 

It is utilized to check whether the length of a segment's esteem is inside a particular range or not. The esteem must be a java.lang.String.

39) What is f:validateLongRange tag in JSF (JavaServer Faces)? 

It is utilized to check whether the nearby estimation of a part is inside a particular range or not. The esteem must be any numeric sort or String that can be changed over to a long.

40) What is f:validateRegex tag in JSF (JavaServer Faces)? 

It is utilized to check whether the nearby estimation of a part is a match against a normal articulation from the java.util.regex bundle or not.

41) What is f:validateRequired tag in JSF (JavaServer Faces)? 

It is utilized to guarantee that the neighborhood esteem isn't void on an EditableValueHolder segment.

42) How to approve oversaw bean in JSF (JavaServer Faces)? 

JSF gives approval limitations to bean show as comments. You can put those explanations on a field, technique, or class of a JavaBeans part, for example, an oversaw bean.

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

The JavaServer Faces gives a lot of Converters. You can utilize that to change over part information. The motivation behind change is to take the String-based information from the Servlet API and convert it to specifically Java objects.

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

It is a center converter tag. It is utilized to add a subjective converter to the parent segment.

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

It is utilized to change over client contribution to the predetermined date. You can change over a segment's information to a java.util.Date by settling the convertDateTime tag inside the part tag. The convertDateTime tag has a few ascribes that enable you to indicate the organization and sort of the information.

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

It is utilized to change over segment (client input) information into a Java Number sort. You can change over a part's information to a java.lang.Number by settling the convertNumber tag inside the segment tag. The convertNumber tag has a few credits that enable you to determine the organization and kind of the information.

47) How to allude bean technique in JSF (JavaServer Faces)? 

We allude an oversaw bean technique that performs route preparing for the segment and returns an intelligent result String.

48) What is Facelets? 

It is a lightweight page revelation language which is utilized to construct JavaServer Faces sees utilizing HTML style.

49) What are the upsides of Facelets? 

1) It bolsters code reusability through templating and composite segments.

2) It gives useful extensibility of segments and other server-side items through customization

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

The JavaServer Faces detail characterizes the lifecycle of a JavaServer Faces application. The accompanying advances depict that procedure to a Facelets-based application.

1) Lifecycle begins when a customer makes another solicitation for a website page which is made utilizing Facelets. JSF makes another part tree or javax.faces.component.UIViewRoot and set into the FacesContext.

51) How to make a Fecelet see? 

Facelets sees are XHTML pages. You can make a page or view, by adding parts to the page, wire the segments to support bean esteems and properties, and register converters, validators, or audience members on the segments.

52) How to delineate Servlet example in JSF (JavaServer Faces) application? 

The arrangement of a JavaServer Faces application is finished by mapping the Faces Servlet in the web organization descriptor document a web.xml.

53) What are the Facelets Templates? 

It is an apparatus which gives the office to execute the UI. Templating is a helpful Facelets highlight that enables you to make a page that will go about as the base for different pages in an application. By utilizing layouts, you can reuse code and abstain from reproducing comparable pages over and over.

54) How to make Facelets Templates? 

Templating is a valuable Facelets include that enables you to make a page that will go about as the base for different pages in an application.

55) What are the Facelets Composite Components? 

JSF furnishes the idea of composite segments with Facelets. The Composite segment is an extraordinary sort of layout that goes about as a part in your application.

56) What are web assets in JSF (JavaServer Faces)? 

JSF web assets are the assets which are required for legitimate rendering in the web application. It incorporates pictures, content records, and any client made part libraries.

57) How to get to CSS (Cascading Style Sheets) File in JSF (JavaServer Faces) application? 

The tag is utilized to get to CSS (Cascading Style Sheets) asset in the web application. You should make a subdirectory inside the assets organizer. 

58) How to get to JS (JavaScript) File in JSF (JavaServer Faces) application? 

The tag is utilized to get to JavaScript record in the web application. You should make a subdirectory inside the assets envelope. 

59) How to move web assets in JSF (JavaServer Faces) application? 

JSF gives an office to put your assets at any segment of your site page and render it to another area. You can move your asset by indicating the objective property.

60) How to make JDBC (Java Database Connectivity) association in JSF (JavaServer Faces) application? 

You can incorporate JSF application to the JDBC. JDBC enables you to store information into the database table.