chapter 9 session. contents a.problem: phone book searching b.problem: phone book management

35
Chapter 9 Session

Upload: cory-pitts

Post on 27-Dec-2015

221 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Chapter 9 Session. Contents A.Problem: Phone Book Searching B.Problem: Phone Book Management

Chapter 9

Session

Page 2: Chapter 9 Session. Contents A.Problem: Phone Book Searching B.Problem: Phone Book Management

Contents

A.Problem: Phone Book Searching

B.Problem: Phone Book Management

Page 3: Chapter 9 Session. Contents A.Problem: Phone Book Searching B.Problem: Phone Book Management

A. Problem: Phone Book Searching

Develop a Phone Book system. The phone book keeps many phone

contact A phone contact including: name,

phone number and address This phone book allows users

search phone contact by name, phone number or address

Page 4: Chapter 9 Session. Contents A.Problem: Phone Book Searching B.Problem: Phone Book Management

Search by address

Page 5: Chapter 9 Session. Contents A.Problem: Phone Book Searching B.Problem: Phone Book Management
Page 6: Chapter 9 Session. Contents A.Problem: Phone Book Searching B.Problem: Phone Book Management

Search by address

Page 7: Chapter 9 Session. Contents A.Problem: Phone Book Searching B.Problem: Phone Book Management
Page 8: Chapter 9 Session. Contents A.Problem: Phone Book Searching B.Problem: Phone Book Management

Solution

1. Developing the view2. Developing the model3. Developing the controller4. View Search Result

Page 9: Chapter 9 Session. Contents A.Problem: Phone Book Searching B.Problem: Phone Book Management

1. Developing the view

Page name: search_ui.jsp Page title: Phone Book Searching Table:

Label “Search”; keywordTextBox; label “Search by”; searchBySelectBox, value: Name, Phone Number, Address; searchButton

Table: No., Name, Phone Number, Address

Page 10: Chapter 9 Session. Contents A.Problem: Phone Book Searching B.Problem: Phone Book Management

keywordTextBox searchBySelect

Box

searchButton

Page 11: Chapter 9 Session. Contents A.Problem: Phone Book Searching B.Problem: Phone Book Management

2. Develop the model

Page 12: Chapter 9 Session. Contents A.Problem: Phone Book Searching B.Problem: Phone Book Management
Page 13: Chapter 9 Session. Contents A.Problem: Phone Book Searching B.Problem: Phone Book Management
Page 14: Chapter 9 Session. Contents A.Problem: Phone Book Searching B.Problem: Phone Book Management

3. Developing the controller

Page 15: Chapter 9 Session. Contents A.Problem: Phone Book Searching B.Problem: Phone Book Management

4. View Search Result

Page 16: Chapter 9 Session. Contents A.Problem: Phone Book Searching B.Problem: Phone Book Management

B. Problem: Phone Book Management

Extend the Phone Book problem above so that it can be able to do the following tasks: View all of phone contacts Add a new phone contact Edit a phone contact Delete a phone contact

Page 17: Chapter 9 Session. Contents A.Problem: Phone Book Searching B.Problem: Phone Book Management

List all phone contacts

Click “Add new contact”

Page 18: Chapter 9 Session. Contents A.Problem: Phone Book Searching B.Problem: Phone Book Management

Add a new phone contact

Click “Truong Minh Ngoc”

Page 19: Chapter 9 Session. Contents A.Problem: Phone Book Searching B.Problem: Phone Book Management

Edit a phone contact

Page 20: Chapter 9 Session. Contents A.Problem: Phone Book Searching B.Problem: Phone Book Management

Delete a phone contact

Click “Delete”

Page 21: Chapter 9 Session. Contents A.Problem: Phone Book Searching B.Problem: Phone Book Management

Search Phone Contact

Click “Search”

Page 22: Chapter 9 Session. Contents A.Problem: Phone Book Searching B.Problem: Phone Book Management

Solution

1. Developing the view2. Developing the model3. Developing the controller

Page 23: Chapter 9 Session. Contents A.Problem: Phone Book Searching B.Problem: Phone Book Management

1. Developing the view

The index.jsp page: searching and viewing all phone contacts

The addedit_ui.jsp : adding new or editting a phone contact

Page 24: Chapter 9 Session. Contents A.Problem: Phone Book Searching B.Problem: Phone Book Management

Index.jsp

Page title: Phone Book Table:

Label “Search”; keywordTextBox; label “Search by”; searchBySelectBox, value: Contact Name, Phone Number, Contact Address; searchButton, value “Search”

Table: No., Name, Phone Number, Address, Delete

Page 25: Chapter 9 Session. Contents A.Problem: Phone Book Searching B.Problem: Phone Book Management

Index.jsp

Page 26: Chapter 9 Session. Contents A.Problem: Phone Book Searching B.Problem: Phone Book Management

addedit_ui.jsp

Page 27: Chapter 9 Session. Contents A.Problem: Phone Book Searching B.Problem: Phone Book Management

addedit_ui.jsp Title: Phone Book Table:

Label:

Label “Contact Name”; nameTextBox

Label “Phone Number”; phoneTextBox

Label “Address” ; addressTextBox

submitButton, value:

Page 28: Chapter 9 Session. Contents A.Problem: Phone Book Searching B.Problem: Phone Book Management

2. Developing the model

2.1. Edit PhoneContact class2.2. Edit PhoneBook class2.3. Add PhoneBookInstance class

Page 29: Chapter 9 Session. Contents A.Problem: Phone Book Searching B.Problem: Phone Book Management

2.1. PhoneContact

Page 30: Chapter 9 Session. Contents A.Problem: Phone Book Searching B.Problem: Phone Book Management

2.2. PhoneBook

Page 31: Chapter 9 Session. Contents A.Problem: Phone Book Searching B.Problem: Phone Book Management

2.3. PhoneBookInstance

Page 32: Chapter 9 Session. Contents A.Problem: Phone Book Searching B.Problem: Phone Book Management

3. Developing the controller

3.1. SearchPhoneContactServlet3.2. AddEditPhoneContactServlet3.3. DeletePhoneContactServlet

Page 33: Chapter 9 Session. Contents A.Problem: Phone Book Searching B.Problem: Phone Book Management

3.1. SearchPhoneContactServlet

Page 34: Chapter 9 Session. Contents A.Problem: Phone Book Searching B.Problem: Phone Book Management

3.2. AddEditPhoneContactServlet

Page 35: Chapter 9 Session. Contents A.Problem: Phone Book Searching B.Problem: Phone Book Management

3.3. DeletePhoneContactServlet