jsf presentation"2"
DESCRIPTION
TRANSCRIPT
www.devoxx.com
www.devoxx.com
Java Server Faces(JSF)
www.devoxx.com3
AgendaDesign Pattern
MVC Design Pattern
What is JSF?
How to build JSF project?
JSF tags
Demo1
Demo2
Demo3
www.devoxx.com4
Each pattern describes a problem which occurs over and over again in our environment,
and then describes the core of the solution to that problem,
in such a way that you can use this solution a million times over
Design Pattern
www.devoxx.com5
• Pattern Name
• Problem
• Solution
• Consequences
Elements of Design Patterns
www.devoxx.com
Model-View-Controller pattern goals
• There are often many ways to present the same problem
• requirements on how a problem is displayed tend to change.
• The MVC design tries to separate the code that represents the problem from the code that presents the problem to the user
• this allows the “presentation” part to be change more easily
6
www.devoxx.com
Model (Business process layer)
Models the data and behavior behind the business process
Responsible for actually doing
● Performing DB queries
● Calculating the business process
www.devoxx.com
View (Presentation layer)
• Display information according to client types
• Display result of business logic (Model)
• Not concerned with how the information was obtained, or from where (since that is the responsibility of Model)
8
www.devoxx.com
Controller (Control layer)
• Serves as the logical connection between the user's interaction and the business services on the back
• Responsible for making decisions among multiple presentations
• A request enters the application through the control layer, it will decide how the request should be handled and what information should be returned
www.devoxx.com
MVC Diagram
10
www.devoxx.com
What is JSF?
• is a Java-based Web application framework intended to simplify development of user interfaces for Java EE applications.
11
www.devoxx.com
Tags Libraries
● JSP page need to declare them
• <%@ taglib uri="http://java.sun.com/jsf/html/" prefix="h" %>
• <%@ taglib uri="http://java.sun.com/jsf/core/" prefix="f" %> 12
www.devoxx.com
• All component tags on the page must be enclosed in the view tag
• <f:view></f:view>
• An input form with child components representing
• data that is either presented to the user or submitted with the form
• <h:form></h:form>
www.devoxx.com
• <h:commandLink value="Second Page" action="second"/>
• <h:commandLink value="Go To index" action="index" />
• <h:commandButton id="submit" value="Submit" action="success" />
• <h:outputText value="JavaServer Faces" />
14
www.devoxx.com
How to build JSFproject?
15
www.devoxx.com
How to build JSFproject?
16
www.devoxx.com
17
www.devoxx.com
18
www.devoxx.com
Demo 1
19
www.devoxx.com
Demo 1
20
www.devoxx.com
Demo 1
21
www.devoxx.com
Demo 2
22
www.devoxx.com
Demo 2
23
www.devoxx.com
Demo 2
24
www.devoxx.com
25
www.devoxx.com
Demo 3
26
www.devoxx.com
27
www.devoxx.com
28
www.devoxx.com
• http://www.arabteam2000-forum.com/
• http://forums.sun.com/forum.jspa?forumID=427
• http://www.javapassion.com/j2ee/#JavaServer_Faces_JSF
www.devoxx.com