Framework for building user interfaces for web applications. It simplifies the development of user interface (often it is one of the most diff. parts of web appli development) Was developed through Java Community Process (JCP) by a group of technology leaders (Sun Microsystems, Oracle, Borland, IBM, etc.) and well-known Java and Web experts.

. Faceletes as the official view technology

Events-based interaction model (as opposed to the old “request/response” model) Reader kits that provide device independence Extendable component and rendering architecture can use different View technologies (ie. Facelets, JSP, Velocity, etc.) A JSF application can save the state of its components in the client response or on the server The state of UI components (and some other objects) is saved at the end of each request (called stateSaving(note: transient true)), and restored upon next creation of that view. Several types of state-saving are available, including Client-side and Server-side state saving. easy and user-friendly process for creating web applications

JSF was created to adhere precisely to MVC design methodology. MVC: Facelet is the XHTML view, and the model is a bean. You typically never deal with servlets directly in a JSF app. Instead you have configuration in faces-config.xml as well as annotations on various classes, which control what the FacesServlet does

A &amp;quot;Managed Bean&amp;quot; is a bean constructed/initialized via injection in the faces-config.xml file. A &amp;quot;Backing Bean&amp;quot; is a bean referenced by JSF pages and is defined in the faces-config.xml file

If you want, from JSF 2.0 you can put the navigation information directly in the page. In this case no extrenal navigation rules are needed. This code specifies that view /pages/inputname.jsp has two outputs, sayHello and sayGoodbye, associated with particular pages.

And now finally we are going to show you smth working and what can help you to start with your own applications. As all of you are familiar with JSP and Java we are gonna skip some part of coding to be in time. Project is about running JSF on Google App Engine, it is not so easy and somehow tricky. What actually façade gives for us? How much people do you have in your team, 3,4, 5? How do work separately and paralelise work, make it more independent and allow developer concentrate on work, instead of numerous discussion about how to stick to other interfaces. In our project for instance I and Iurii are developing server part, which is hidden under façade. Firstly we introduce façade with it’s all needed functions for web pages and return dummy objects to have possibility to work on the interface. And then all our team is working further, guys finishing server part and exchanging dummy functions on real onces, and girls are implementing each one JSF page with beans.

11.
Request Processing Life Cycle Scenarios
 Faces response
A servlet response that was created by the execution of the Render Response
Phase of the request processing life cycle.
 Non-Faces response
A servlet response that was not created by the execution of the render
response phase.
 Faces request
A servlet request that was sent from a previously generated Faces response.
 Non-Faces request
A servlet request that was sent to an application component, such as a servlet
or JSP page, rather than directed to a JavaServer Faces component tree.
Web Technologies11

28.
Comparison of JSF and JavaScript
JavaScript: client side technology
JSF: client-server side technology
Using JSF takes more time, because it needs to have stable
connection with server.
Web Technologies28

29.
Pros and cons of JSF
Many implementation providers
(Oracle, IBM, JBoss)
Lack of client-side validation
JSF allows you to create reusable
components, thereby increasing
productivity
Undeveloped tool support
(NetBeans and Eclipse 3.6.)
Many ready to use components from
major developers: Apache, Richfaces,
Infragistics, Oracle, etc.
JSF only comes with validators for missing
values, length of input, and numbers in a
given range
Excellent implementation of the validators
and converters concepts. Unlike Struts, JSF
stores the validation logic in close
proximity of the component description
Different JavaScript implementation of
Ajax in every browser with different bugs
and different proprietary extensions
A well-designed action listeners concept Overloaded client-server communication
Injected into the components of JavaScript
code and excellent support for Ajax
Hard to develop efficient application, has
to change standard components
Web Technologies29

36.
JSF bean
Web Technologies36
@ManagedBean // defines a bean for JSF
@ApplicationScoped // scope of the bean
public class ReserveManagerBean implements Serializable
{…}
public ReserveManagerBean();
// constructor for the bean, don’t mix up with page crating or accessing
public void updateMovies(ValueChangeEvent event);
//listener for the selectOneMenu, when cinema is selected
public void setupMovie(ValueChangeEvent event);
// listener for the selectOneMenu, when movie is selected
public void save(ActionEvent event);
//listener to the dialog button, to save new reservation
private void refreshNames();
//internal function, reshreshing data from the DB, as it can be changes
by //another user in any time, also on the web page
Methods