JSF
JSF
JAVASERVER
FACES
J AVA S E R V E R FA C E S
Facelets Technology
Expression Language
Expression Language provides an important mechanism for creating the user interface (web pages) to
communicate with the application logic (managed beans). The EL represents a union of the expression
languages offered by JavaServer Faces technology.
HTML 5
HTML5 is the new standard for writing web pages. JavaServer Faces version 2.2 offers an easy way for
including new attributes of HTML 5 to JSF components and provides HTML5 friendly markup.
JSF provides rich set of inbuilt tools and libraries so that you can easily and rapidly develop we application.
J S F M A I N F E AT U R E S
Support Internationalization
JSF supports internationalization for creating World Class web application. You can create
applications in the different-different languages. With the help of JSF you can make the application
adaptable to various languages and regions.
Bean Annotations
JSF provides annotations facility in which you can perform validation related tasks in Managed Bean.
It is good because you can validate your data in bean rather than in HTML validation.
Exception Handling
JSF provide default Exception handling so you can develop exception and bug free web application.
J S F M A I N F E AT U R E S
• Templating
• Introducing template in new version of JSF provides reusablity of components. In JSF application,
you can create new template, reuse template and treat it as component for application.
• AJAX Support
• JSF provides inbuilt AJAX support. So, you can render application request to server side without
refreshing the web page. JSF also support partial rendering by using AJAX.
• Security
• JSF provides implicit protection against this when state is saved on the server and no stateless
views are used, since a post-back must then contain a valid javax.faces.ViewState hidden
parameter. Contrary to earlier versions, this value seems sufficiently random in modern JSF
implementations. Note that stateless views and saving state on the client does not have this
implicit protection.
J AVA S E R V E R
FA C E S
LIFECYCLE
L I F E C Y C L E S TA G E
JavaServer Faces application framework manages
lifecycle phases automatically for simple
applications and also allows you to manage that
manually. The lifecycle of a JavaServer Faces
application begins when the client makes an HTTP
request for a page
The JSF lifecycle and ends
is divided when
into twothe server
main phases:
responds with the page.
Render Phase
• JSF begins the restore view phase as soon as a link or a button is clicked and JSF
receives a request.
• During this phase, the JSF builds the view, wires event handlers and validators to UI
components and saves the view in the FacesContext instance.
• The FacesContext instance will now contains all the information required to process
a request
PHASE 1:
RESTORE VIEW
PHASE 2: A P P LY REQUEST VALUES
In this phase, the values that are entered by the user will be
updated on each and every individual component defined in
the View graph.
These validations
This Phase will will only happen
process any for the UI
Validations that Components only
are configured if the property
for UI 'rendered'
Components. property is set to
'true'.
PHASE 4: UPDATE MODEL VALUES
PHASE 5:
INVOKE
A P P L I C AT I O N In this phase, JSF Implementation
will call the
UIComponentBase.processApplica
tions() method which will
immediately call the Render
Response Phase.
PHASE 6: RENDER RESPONSE
DOWNLOAD https://jstl.java.net/downloa
d.html
.