1. Trang chủ
  2. » Công Nghệ Thông Tin

lecture1

17 249 0
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

csd

Server-side Web ProgrammingLecture 1: Course Introduction and Overview 2Client-Server Web Architecture•Client browser sends request for page to server–May contain form data and other information•Server sends response page and sends to client•May need to generate response page dynamically–Form parameters–Previous requests (such as items purchased so far)–Information in databaseFocus of this course 3Client-Server Web ArchitectureClientBrowserwww.cis.ysu.edu/~john/Syllabus.htmRequest to www.cis.ysu.edu for Syllabus.htmServerjohn public_html Syllabus.htmportResponse containing Syllabus.htm as a long string (<html><head><title>CSCI 6962 Syllabus</title></head><body>…) 4Form Handling•Form data appended to request stringGenerates the request:http://frodo.cis.ysu.edu/~john/cgi-bin/test.pl&quantity=3<FORM NAME="purchaseform" METHOD=GET ACTION=http://frodo.cis.ysu.edu/~john/cgi-bin/test.pl>Quantity: <INPUT TYPE="text" SIZE="8" NAME="quantity" /><BR /><BR /><INPUT TYPE="submit" VALUE="SUBMIT"></FORM> 5Form HandlingServer must:–Listen on port for requests–Parse request to determine values of parameters–Generate appropriate response page based on parameter values–Send response page back to client 6Course Topics•Server-side Web Containers•Java Server Pages•Web Site Architecture•Session Handling•Database Manipulation•Mobile Device Handling•Security 7Web Containers•Program running continuously on server•Runs code to handle requests and generate responses•Handles other important functions:–Session tracking–Database access–Email generation–Security and encryption 8Server Pages•Perl/cgi-bin approach: Generate response page one character at a time•Server page approach:Create html “template” with “spaces” to be filled in<HTML><HEAD><TITLE>cgi-bin response</TITLE></HEAD><BODY><P>Thank you for your order of insert value of quantity here widgets!</P></BODY></HTML> 9Java Server Pages<HTML><HEAD><TITLE>cgi-bin response</TITLE></HEAD><BODY><P>Thank you for your order of <%= request.getParameter(“quantity”) %>widgets!</P></BODY></HTML> 10Control-View Architecture•Different user input might require different response pages–Different types of request–Errors/missing field values, etc.•Servlets: Code to determine and redirect to appropriate response JSPrequestControl servletJSPJSPJSPresponseJSPs for views 123doc.vn

Ngày đăng: 04/01/2013, 17:57

Xem thêm: lecture1

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN