Java Server Faces Interview Questions and Answers 1072
Java Server Faces Interview Questions and Answers 1072
Global Guideline.
https://globalguideline.com/
Java Server Faces Interview Questions And Answers
G
Java Server Faces Job Interview Preparation Guide.
lo
ba
lG
Question # 1
What is JSF Taglibs?
ui
Answer:-
The JSF Taglibs are of two.
HTML Tag lib
de
Core Tag lib
HTML Tag lib: This tag library contains all the tags that pertains all the tags that are to deal with forms and other HTML-specific stuff.
Core Tag lib: The Core Tag lib contains the tags that pertaining all the tags that are to deal with logic, validation, controller and other JSF-specific stuff.
The two tag libs are to be specified as follows:
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
lin
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
Read More Answers.
Question # 2
e
Tell me how the components of JSF are rendered?
Answer:-
.C
JSF libraries need to be added in an application.
On the .jsp page, a tag library needs to be added:
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
In an XML style:
O
<?xml version="1.0"?>
<jsp:root version="2.0" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html">
The JSF components can be accessed using the prefix attached.
M
In an IDE, JSF can be added easily. However, when working without them the faces-config.xml needs to be updated and populated with classes i.e. Managed Beans
between the following tags
<faces-config> </faces-config>
Read More Answers.
Question # 3
Explain JSF Architecture?
Answer:-
JSF developed based on MVC design pattern. Therefore, the applications can be scaled better and well maintained. It is standardized pattern driven by Java
Community Process. The advantage of JSF is both Java web user interface and a framework which perfectly fits with MVC. The presentation and behaviour of a web
application is a clean separation. UI can be created by web page authors and the business logic can be utilized by managed beans. There are controllers which can be
used to perform user actions.
Read More Answers.
Question # 4
Tell me JSF supports AJAX?
Answer:-
Ajax support can be added to the following panel components.
<hx:panelActionbar>
<hx:panelBox>
<hx:panelDialog>
<hx:panelFormBox>
<h:panelGrid>
<h:panelGroup>
<hx:panelLayout>
<hx:panelMenu>
<hx:panelSection>
To add Ajax support to a JSF page:
Copyright © https://globalguideline.com Page 2/7
Java Server Faces Interview Questions And Answers
Question # 7
Explain Shale?
e
Answer:-
Shale is a framework for web applications, based on JSF. Shale architecture includes a set of loosely coupled services which can be combined to meet specific
.C
application requirements. The additional functionality provided by Shale - application event callbacks, dialogs with conversation-scoped state, a view technology
named Clay, annotation-based functionality. These functionalities will reduce the requirement of configuration and provides support for remote computing. Other
framework links for integration is provided by Shale, which eases the combined technology based development.
Read More Answers.
O
Question # 8
Do you know what is AJAX and what problem does it solve?
M
Answer:-
Ajax is a set of client side technologies that allows asynchronous communication between client and web server. In synchronous communication, complete round trip
happens with each request/response action event when small data of the page to be refreshed. Ajax has solved this problem of posting entire information every time
through asynchronous communication.
XmlHttpRequest is the basic fundamental behind Ajax. This allows browser to communicate with server without making post backs.
Read More Answers.
Question # 9
What is Apache Tomahawk?
Answer:-
A series of JSF components are provided by MyFaces Tomahawk. Tomahawk provides several custom components that are 100% JSF compatible components. It is
easier to implement JSF projects with Tomahawk. The extended functionalities are â€" improved inputText components, Converter interfaces and solutions to use
JSF and Tiles together.
Read More Answers.
Question # 10
What is JSF life cycle?
Answer:-
i. Restore view phase:
This phase starts when a user requests a JSF page by clicking a link, button etc. In this phase view generation of the page, binding of components to its event handlers
and validators are performed and view is saved in the FacesContext object.
ii. Apply request values phase:
The purpose of this phase is for each component to retrieve its current state.
iii. Process validations phase:
During this phase local values stored for the component in the tree are compared to the validation rules registered for the components.
iv. Update model values phase:
After confirming that data is valid in the previous phase local values of components can be set to corresponding server side object properties i.e. backing beans.
Copyright © https://globalguideline.com Page 3/7
Java Server Faces Interview Questions And Answers
Question # 12
lG
Explain JSF framework?
Answer:-
JavaServer Faces (JSF) is a user interface framework for building web applications that run on the server side and render the user interface back to the client.
It lets you develop tools that simplify coding web-based Java applications.
ui
Users of your JSF-based web applications can use the wide range of user actions made available by JSF controls. More features can be offered more conveniently
than they can be with a standard HTML front end. JSF requires little more effort than an ordinary JSP configuration but still has more benefits.
Read More Answers.
de
Question # 13
Explain JSF life cycle?
lin
Answer:-
The JavaServer Faces page is similar to JSP page in terms of their life cycle.
When user makes a request, the life cycle of a JSF web application, starts.
Several tasks are performed by JSF when a user submits a page. These tasks include data validation, data type conversion, etc.
A JSF application supports two kinds of responses and two kinds of requests.
e
Faces response:
Request processing life cycle creates a servlet response by the execution of the Render Response Phase of the.
Non-Faces response:
.C
A servlet response is not created by the execution of the render response phase.
Faces request:
A servlet request is sent from a previously generated Faces response. E.g.: The request URI in the form submission from a JSF UI component, identifies the JSF
component tree to use for processing the request.
Non-Faces request:
A servlet request is sent to an application component, such as a servlet or JSP page, rather than directed to a JavaServer Faces component tree.
O
The steps in the life cycle of a JSF application are:
1. Restore View Phase
2. Apply Request Value Phase
M
3. Process Validations Phase
4. Update Model Value Phase
5. Invoke Application Phase
6. Render Response Phase
Read More Answers.
Question # 14
What is Seam?
Answer:-
Seam is a framework for web application, which combines the existing popular frameworks â€" EJB and JSF. A back-end component of an enterprise (EJB) can be
accessed by the front-end by addressing its name of the Seam component.
The concept of ‘context' is expanded by Seam. The context contains each Seam component. The context of a session captures the actions of all logged in users until
he logs out. A command line tool seam-gen can be used to automatically generate the actions â€" create, read, update, delete (CRUD) of a web application. The
integration of Seam can be with JBOSS, RichFaces or ICEFaces AJAX libraries.
Read More Answers.
Question # 15
What is JavaServer Faces, JSF?
Answer:-
JavaServer Faces technology includes:
A set of APIs for representing UI components and managing their state, handling events and input validation, defining page navigation, and supporting
internationalization and accessibility.
A JavaServer Pages (JSP) custom tag library for expressing a JavaServer Faces interface within a JSP page.
Designed to be flexible, JavaServer Faces technology leverages existing, standard UI and web-tier concepts without limiting developers to a particular mark-up
language, protocol, or client device.
Ease-of-use being the primary goal, the JavaServer Faces architecture clearly defines a separation between application logic and presentation while making it easy to
connect the presentation layer to the application code.
Developed through the Java Community Process under JSR - 314, JavaServer Faces technology establishes the standard for building server-side user interfaces.
Read More Answers.
Question # 16
Can you explain JSF Ajax components?
Answer:-
G
The custom web tier components for JSF can be developed using AJAX along with JSF. Using JSF the state of an application, event handling, input validation and
page navigation tasks can be done for user interface components. AJAX technology is used for client side Java Script leverage in order to provide richer and more
responsive user experience.
lo
To implement the JSF component for spell check text area, the following tag is used.
<jcr: spellCheckTextArea cols="30" rows="15" value="# {user.interests}" />
This component extends HtmlInputTextArea provides a simple AJAX-enabled spell checking facility
ba
Read More Answers.
Question # 17
Explain how JSF different from conventional JSP?
lG
Answer:-
JSP is good for mixing static content and dynamic content pulled from resources made available by other parts of the application; for instance, a servlet.
JSP's main mission in life is to generate a response to a request; a JSP page is processed in one pass from top to bottom, with JSP action elements processed in the
order in which they appear in the page.
However, JSF has a much more complex lifecycle.
ui
JSF components get created, process their input (if any), and then render themselves.
For JSF to work well, these three things must happen separately in a well-defined order, but when JSF is used with JSP, they don't.
Instead, the component creation and rendering happens in parallel, causing all kinds of problems.
de
Read More Answers.
Question # 18
Do you know how to declare the Navigation Rules for JSF?
lin
Answer:-
A navigation rule specifies the JSF implementation which page need to send back to the browser after submitting a form. For instance, after the successful login, the
page should to Main page or to return on the same login page. The following code snippet describes this.
<navigation-rule>
e
<from-view-id>/login.jsp</from-view-id>
<navigation-case>
<from-outcome>login</from-outcome>
.C
<to-view-id>/main.jsp<to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>fail</from-outcome>
<to-view-id>/login.jsp<to-view-id>
</navigation-case>
O
</navigation-rule>
from-outcome to be match with action attribute of the command button of the login.jsp as:
<h:commandbutton value="Login" action="login"/>
M
Secondly, it should also match with the navigation rule in face-config.xml as
<managed-bean>
<managed-bean-name>user</managed-bean-name>
<managed-bean-class>core.jsf.LoginBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
In the UI component, to be declared / used as:
<h:inputText value="#{user.name}"/>
value attribute is the name property of the user bean.
Read More Answers.
2 : Java Swing Programming Frequently Asked Interview Questions and Answers Guide.
10 : Java Servlet Programming Frequently Asked Interview Questions and Answers Guide.
About Global Guideline.
Global Guideline is a platform to develop your own skills with thousands of job interview questions
and web tutorials for fresher's and experienced candidates. These interview questions and web
tutorials will help you strengthen your technical skills, prepare for the interviews and quickly revise
the concepts. Global Guideline invite you to unlock your potentials with thousands of Interview
Questions with Answers and much more. Learn the most common technologies at Global Guideline.
We will help you to explore the resources of the World Wide Web and develop your own skills from
the basics to the advanced. Here you will learn anything quite easily and you will really enjoy while
learning. Global Guideline will help you to become a professional and Expert, well prepared for the
future.
* If any answer or question is incorrect or inappropriate or you have correct answer or you found any
problem in this document then don't hesitate feel free and e-mail us we will fix it.
You can follow us on FaceBook for latest Jobs, Updates and other interviews material.
www.facebook.com/InterviewQuestionsAnswers
Best Of Luck.