0% found this document useful (0 votes)
187 views22 pages

41 Slide

0132130807 Objectives To explain what JSF is (SS41.1) to create a JSF page using NetBeans (SS41).2. To create JSF UI components (e.g., text field, button, Drop down list, list box, radio Button group, check box group, text area, table) (SS41.3) to use JSF containers Grid Panel, group panel, and Layout Panel to group components. To validate input using Message components (SS41.6).

Uploaded by

Hoàng Vũ
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
187 views22 pages

41 Slide

0132130807 Objectives To explain what JSF is (SS41.1) to create a JSF page using NetBeans (SS41).2. To create JSF UI components (e.g., text field, button, Drop down list, list box, radio Button group, check box group, text area, table) (SS41.3) to use JSF containers Grid Panel, group panel, and Layout Panel to group components. To validate input using Message components (SS41.6).

Uploaded by

Hoàng Vũ
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 22

Chapter 41 JavaServer Face

Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved. 0132130807

Objectives
To

explain what JSF is (41.1). To create a JSF page using NetBeans (41.2). To create JSF UI components (e.g., Static Text, Text Field, Button, Drop Down List, List Box, Radio Button Group, Check Box Group, Text Area, Table) (41.3). To use JSF containers Grid Panel, Group Panel, and Layout Panel to group components (41.4). To bind data with JSF UI components (41.5). To validate input using Message components (41.6).

Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved. 0132130807

What is JSF?
JSF supports visual Web development. You can create a Web user interface using a tool without writing any code. JSF completely separates Web UI from Java code so the application developed using JSF is easy to debug and maintain.

Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved. 0132130807

Visual Web Design Using NetBeans


Create a Web project with Visual Web JavaServer Faces.

Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved. 0132130807

Creating UI in the Design Pane

Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved. 0132130807

Creating UI in the Design Pane


Drop a Static Text and set its properties

Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved. 0132130807

Creating UI in the Design Pane


Write the code in the Java tab.

Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved. 0132130807

Examining the JSP File


Click the JSP tab to see the JSP file. Whenever you add, remove, or change the UI components in the Design pane, the contents in the JSP are also updated. It is possible to modify the JSP file directly, but it is not recommended for the new users. Modifying the JSP file mistakenly could corrupt the entire project. You can completely ignore the JSP file when using this tool.

Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved. 0132130807

JSF UI Components

Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved. 0132130807

JSF UI Components

Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved. 0132130807

10

JSF UI Containers

Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved. 0132130807

11

JSF UI Containers

Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved. 0132130807

12

Binding Data with UI Components

Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved. 0132130807

13

Creating a New Database Connection

Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved. 0132130807

14

Creating a New Database Connection

Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved. 0132130807

15

Designing UI

Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved. 0132130807

16

Modifying Query

Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved. 0132130807

17

Modifying Query

Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved. 0132130807

18

Changing Table Layout

Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved. 0132130807

19

Session Tracking

Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved. 0132130807

20

Session Bean

Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved. 0132130807

21

Validating Input

Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved. 0132130807

22

You might also like