Professional Documents
Culture Documents
Javaserver Faces (JSF)
Javaserver Faces (JSF)
Javaserver Faces (JSF)
أبيسلّوم
ّ . م:إعداد
?What is JavaServer Faces
• JSF stands for Java Server Faces. It is a server-side Java
framework for web development.
• The JSF Tag libraries are used to add components on the web
pages and connect components with objects on the server.
• It is written in Java.
Benefit of JavaServer Faces
• Bean Annotations.
• In short, the use of Facelets reduces the time and effort that
needs to be spent on development and deployment.
Faces Servlet
• Initializes resources
• Accepts all incoming JSF requests
• Passes requests to the request lifecycle for processing
• It validates expression language at compile-time.
• Faster compilation time.
• High-performance rendering.
– using annotations.
import javax.faces.bean.*;
@ManagedBean // Using ManagedBean annotation
@RequestScoped // Using Scope annotation
.Request scope persists during a single HTTP request in a web application //
public class User {
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
Expression Language
• Expression Language (EL) provides an important mechanism
for creating the user interface (web pages) to communicate
with the application logic (managed beans)
<h:body>
<h:form>
</h:form>
</h:body>
Good luck