jsf presentation"2"

30
www.devoxx.com

Upload: mufix-community

Post on 13-Jan-2015

1.658 views

Category:

Education


7 download

DESCRIPTION

 

TRANSCRIPT

Page 1: JSF Presentation"2"

www.devoxx.com

Page 2: JSF Presentation"2"

www.devoxx.com

Java Server Faces(JSF)

Page 3: JSF Presentation"2"

www.devoxx.com3

AgendaDesign Pattern

MVC Design Pattern

What is JSF?

How to build JSF project?

JSF tags

Demo1

Demo2

Demo3

Page 4: JSF Presentation"2"

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

Page 5: JSF Presentation"2"

www.devoxx.com5

• Pattern Name

• Problem

• Solution

• Consequences

Elements of Design Patterns

Page 6: JSF Presentation"2"

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

Page 7: JSF Presentation"2"

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

Page 8: JSF Presentation"2"

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

Page 9: JSF Presentation"2"

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

Page 10: JSF Presentation"2"

www.devoxx.com

MVC Diagram

10

Page 11: JSF Presentation"2"

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

Page 12: JSF Presentation"2"

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

Page 13: JSF Presentation"2"

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>

Page 14: JSF Presentation"2"

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

Page 15: JSF Presentation"2"

www.devoxx.com

How to build JSFproject?

15

Page 16: JSF Presentation"2"

www.devoxx.com

How to build JSFproject?

16

Page 17: JSF Presentation"2"

www.devoxx.com

17

Page 18: JSF Presentation"2"

www.devoxx.com

18

Page 19: JSF Presentation"2"

www.devoxx.com

Demo 1

19

Page 20: JSF Presentation"2"

www.devoxx.com

Demo 1

20

Page 21: JSF Presentation"2"

www.devoxx.com

Demo 1

21

Page 22: JSF Presentation"2"

www.devoxx.com

Demo 2

22

Page 23: JSF Presentation"2"

www.devoxx.com

Demo 2

23

Page 24: JSF Presentation"2"

www.devoxx.com

Demo 2

24

Page 25: JSF Presentation"2"

www.devoxx.com

25

Page 26: JSF Presentation"2"

www.devoxx.com

Demo 3

26

Page 27: JSF Presentation"2"

www.devoxx.com

27

Page 28: JSF Presentation"2"

www.devoxx.com

28

Page 29: JSF Presentation"2"

www.devoxx.com

• http://www.arabteam2000-forum.com/

• http://forums.sun.com/forum.jspa?forumID=427

• http://www.javapassion.com/j2ee/#JavaServer_Faces_JSF

Page 30: JSF Presentation"2"

www.devoxx.com