Your SlideShare is downloading. ×
Lecture1
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Lecture1

624

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
624
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Server-side Web Programming Lecture 1: Course Introduction and Overview
  • 2. Client-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 database
    Focus of this course
  • 3. Client-Server Web Architecture Client Browser www.cis.ysu.edu/ ~john/Syllabus.htm Request to www.cis.ysu.edu for Syllabus.htm Server john public_html Syllabus.htm port Response containing Syllabus.htm as a long string ( <html><head><title>CSCI 6962 Syllabus</title></head><body>…)
  • 4. Form Handling
    • Form data appended to request string
    • Generates the request:
    • http://frodo.cis.ysu.edu/~john/cgi-bin/test.pl &quantity=3
    <FORM NAME=&quot;purchaseform&quot; METHOD=GET ACTION= http://frodo.cis.ysu.edu/~john/cgi-bin/test.pl > Quantity: <INPUT TYPE=&quot;text&quot; SIZE=&quot;8&quot; NAME=&quot;quantity&quot; /> <BR /><BR /> <INPUT TYPE=&quot;submit&quot; VALUE=&quot;SUBMIT&quot;> </FORM>
  • 5. Form Handling
    • Server 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
  • 6. Course Topics
    • Server-side Web Containers
    • Java Server Pages
    • Web Site Architecture
    • Session Handling
    • Database Manipulation
    • Mobile Device Handling
    • Security
  • 7. Web 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
  • 8. Server 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>
  • 9. Java 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>
  • 10. Control-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 JSP
    request Control servlet JSP JSP JSP response JSPs for views
  • 11. User-friendly Error Handling
    • Tell user what went wrong
    • Don’t force re-entry of information
  • 12. Session Handling
    • Most web transactions are sessions consisting of series of requests and responses
    • No easy way to associate steps if multiple clients
    Who submitted this request?
  • 13. Session Handling
    • Assign each new client a unique ID at the start of a session
    • Client/server pass that ID back and forth with each request/response
    • Data for that client (such as “shopping cart”) associated with ID on server
  • 14. Database Manipulation
    • Database driver provides access to databases
    • JDBC : classes to query/manipulate database
    • Efficiency issues
      • Prepared statements
      • Connection pooling
    web container control servlet JSP database database driver JDBC DBMS database server
  • 15. Tools We will be Using
    • Jakarta Tomcat web container
    • Java programming language
    • NetBeans IDE
    • MySQL database server
    • All are free downloads (see Chapters 2 and 3)
  • 16. Background Knowledge
    • Java or C++
      • May want to get Java reference
      • Sun reference page
    • Basic html (including forms and tables)
      • May want reference
      • Chapter 4 of text
  • 17. Assignments
    • Short programming assignments in core areas
      • Java Server Pages
      • Validation/redirection servlets
      • Session handling
    • Web Site Project
      • Multi-page web site in area of your choice
      • Includes server pages, servlets, and session handling
      • Should include at least one other advanced capability
        • Database access
        • Mobile device handling
        • Security
      • Can be group project

×