CSCI 6962: Server-side Design and Programming Course Introduction and Overview.

Slides:



Advertisements
Similar presentations
CSCI 6962: Server-side Design and Programming Input Validation and Error Handling.
Advertisements

Lecture 6/2/12. Forms and PHP The PHP $_GET and $_POST variables are used to retrieve information from forms, like user input When dealing with HTML forms.
Server-Side vs. Client-Side Scripting Languages
J4www/jea Week 3 Version Slide edits: nas1 Format of lecture: Assignment context: CRUD - “update details” JSP models.
Introduction to Web Database Processing
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic Server Side Web Technologies: Part 2.
1 Static Web Pages Websites on Servers (The Big Picture) –Apache Tomcat can support static web pages –Primarily intended to support servlets and JSP –Some.
Performed by:Gidi Getter Svetlana Klinovsky Supervised by:Viktor Kulikov 08/03/2009.
1 CS6320 – Why Servlets? L. Grewe 2 What is a Servlet? Servlets are Java programs that can be run dynamically from a Web Server Servlets are Java programs.
How Clients and Servers Work Together. Objectives Learn about the interaction of clients and servers Explore the features and functions of Web servers.
Chapter 11 ASP.NET JavaScript, Third Edition. 2 Objectives Learn about client/server architecture Study server-side scripting Create ASP.NET applications.
Computer Science 101 Web Access to Databases Overview of Web Access to Databases.
ECE356 – Database Systems Lab 1 – Building a Web Project with NetBeans Tiuley Alguindigue Lab Instructor – University of Waterloo, E & CE Dept. Fall 2013.
2440: 141 Web Site Administration Web Server-Side Programming Professor: Enoch E. Damson.
CSCI 6962: Server-side Design and Programming History and Background.
Gayle J Yaverbaum, PhD Professor of Information Systems Penn State Harrisburg.
Quick Tour of the Web Technologies: The BIG picture LECTURE A bird’s eye view of the different web technologies that we shall explore and study.
DAT602 Database Application Development Lecture 15 Java Server Pages Part 1.
Server Side Scripting Norman White. Where do we do processing? Client side – Javascript (embed code in html) – Java applets (send java program to run.
1 Web Developer & Design Foundations with XHTML Chapter 6 Key Concepts.
INTRODUCTION TO WEB DATABASE PROGRAMMING
1 Homework / Exam Exam 3 –Solutions Posted –Questions? HW8 due next class Final Exam –See posted schedule Websites on UNIX systems Course Evaluations.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
CSCI 6962: Server-side Design and Programming Course Introduction and Overview.
CSCI 6962: Server-side Design and Programming
Copyright © cs-tutorial.com. Introduction to Web Development In 1990 and 1991,Tim Berners-Lee created the World Wide Web at the European Laboratory for.
Chapter 5 Java Script And Forms JavaScript, Third Edition.
CSCI 6962: Server-side Design and Programming Introduction to AJAX.
CSCI 6962: Server-side Design and Programming JDBC Database Programming.
Basics of Web Databases With the advent of Web database technology, Web pages are no longer static, but dynamic with connection to a back-end database.
Data-Enabled Web Sites: Classibooks.com & Internet Database Technologies Colin Fukai April 4, 2000 Gonzaga University.
CSCI 6962: Server-side Design and Programming Validation Tools in Java Server Faces.
JavaScript, Fourth Edition
Chapter 17 - Deploying Java Applications on the Web1 Chapter 17 Deploying Java Applications on the Web.
JSP Java Server Pages Softsmith Infotech.
Web Programming: Client/Server Applications Server sends the web pages to the client. –built into Visual Studio for development purposes Client displays.
CSCI 6962: Server-side Design and Programming Introduction to Java Server Faces.
CSCI 6962: Server-side Design and Programming Web Services.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
1 Accelerated Web Development Course JavaScript and Client side programming Day 2 Rich Roth On The Net
CSCI 6962: Server-side Design and Programming Introduction to Active Server Pages.
Chapter 8 Cookies And Security JavaScript, Third Edition.
Creating Dynamic Web Pages Using PHP and MySQL CS 320.
JavaScript, Fourth Edition Chapter 5 Validating Form Data with JavaScript.
Active Server Pages  In this chapter, you will learn:  How browsers and servers interacted on the Internet when the Internet first became popular 
Chapter 8 Collecting Data with Forms. Chapter 8 Lessons Introduction 1.Plan and create a form 2.Edit and format a form 3.Work with form objects 4.Test.
Chapter 6 Server-side Programming: Java Servlets
CSCI 6962: Server-side Design and Programming Database Manipulation in ASP.
Java server pages. A JSP file basically contains HTML, but with embedded JSP tags with snippets of Java code inside them. A JSP file basically contains.
CSCI 6962: Server-side Design and Programming Java Server Faces Scoping and Session Handling.
BlackBerry Applications using Microsoft Visual Studio and Database Handling.
JSP Server Integrated with Oracle8i Project2, CMSC691X Summer02 Ching-li Peng Ying Zhang.
 Previous lessons have focused on client-side scripts  Programs embedded in the page’s HTML code  Can also execute scripts on the server  Server-side.
CS562 Advanced Java and Internet Application Introduction to the Computer Warehouse Web Application. Java Server Pages (JSP) Technology. By Team Alpha.
Fall 2000C.Watters1 World Wide Web and E-Commerce Servers & Server Side Processing.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
ASP. ASP is a powerful tool for making dynamic and interactive Web pages An ASP file can contain text, HTML tags and scripts. Scripts in an ASP file are.
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
1 CSC160 Chapter 1: Introduction to JavaScript Chapter 2: Placing JavaScript in an HTML File.
Fall 2000C.Watters1 World Wide Web and E-Commerce Servers & Server Side Processing.
A Presentation Presentation On JSP On JSP & Online Shopping Cart Online Shopping Cart.
CS 562 Advanced Java and Internet Application Computer Warehouse Web Application By Team Alpha :-  Puja Mehta (102163)  Mona Nagpure (102147)
Chapter 1 Getting Started with ASP.NET Objectives Why ASP? To get familiar with our IDE (Integrated Development Environment ), Visual Studio. Understand.
1 Chapter 1 INTRODUCTION TO WEB. 2 Objectives In this chapter, you will: Become familiar with the architecture of the World Wide Web Learn about communication.
Tonga Institute of Higher Education IT 141: Information Systems
WWW and HTTP King Fahd University of Petroleum & Minerals
Tonga Institute of Higher Education IT 141: Information Systems
Tonga Institute of Higher Education IT 141: Information Systems
Presentation transcript:

CSCI 6962: Server-side Design and Programming 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 ~john/Syllabus.htm Request to for Syllabus.htm Server john  public_html  Syllabus.htm port Response containing Syllabus.htm as a long string ( CSCI 6962 Syllabus …)

4 Form Handling Form data appended to request string Generates the request: <FORM NAME="purchaseform" METHOD=GET ACTION= > Quantity: /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 Simple perl cgi-bin Program #!/opt/local/bin/perl #program to print back results of test form #parse input string into an associative $ENV{'QUERY_STRING'}); foreach $pair $pair); $formdata{$key}=$value; } #print response to form print "Content-type: text/html\n\n"; print " cgi-bin response "; print "Thank you for your order of "; print $formdata{"quantity"}; print " widgets!"; print " "; Problem: Too difficult to do complex server-side development Database manipulation Security …

7 Course Topics Server-side Web Containers Java Server Pages/Active Server Pages Web Site Architecture Session Handling AJAX Database Manipulation Security , etc.

8 Web Containers Program running continuously on server Runs code to handle requests Built-in methods for parsing requests, generating responses Handles other important functions: –Session tracking –Database access – generation –Security and encryption

9 Web Containers Client Browser Server Port Web Container Constantly running in background Listen on port Execute code in requested server page Generate corresponding html page cgi-bin response Thank you for your order of widgets!

10 Web Containers Jakarta Tomcat –Written in Java –NetBeans IDE –Acts as engine for Java Server Pages and servlets Microsoft IIS –Visual Basic/C# –Acts as engine for Active Server Pages

11 Java Server Pages Perl/cgi-bin approach: Generate response page one character at a time Java Server Page approach: Create html “template” with “spaces” to be filled in Reciept Thank you for your order of insert value of quantity here widgets!

12 Java Server Pages Reciept Thank you for your order of widgets!

13 Active Server Pages Active Server Page approach: Create “form” which is translated to html

14 Active Server Pages Server-side code manipulates “form elements” –Subroutine called when page submitted –Data read from elements (actually request string) –Used to set value of other elements

15 Active Server Pages Resulting form translated to response page

16 Control-View Architecture Different user input might require different response pages –Different types of request –Errors/missing field values, etc. Servlets/Multipage sites: Code to determine and redirect to appropriate response JSP request Control servlet JSP response JSPs for views

17 Form Validation Detecting user error –Invalid form information –Inconsistencies of forms to other entities Enter ID not in database, etc. Correcting user error –Providing information or how to correct error –Reducing user memory load Preventing user error –Good instructions –Field types/values that prevent error –Error tolerance Example: Accepting phone numbers in multiple formats

18 User-friendly Error Handling Tell user what went wrong Don’t force re-entry of information

19 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?

20 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

21 AJAX Response is entire web page Very inefficient –High network costs –Must be loaded into browser and rendered Problem: Browser itself cannot get any data from server without requesting entire page Request ClientServer Response Large Document

22 AJAX Based on JavaScript running in browser –JavaScript code sends data to server, reads response –Response is simple data instead of entire page –JavaScript code then modifies page without re- rendering it completely –AJAX: Asynchronous JavaScript and XML Request Web Page Server Response JavaScript Small Data

23 Database Manipulation Database driver provides access to databases JDBC: classes to query/manipulate database Reliability/Efficiency issues –Synchronization –Prepared statements –Connection pooling web container control servlet JSP database database driver JDBC DBMS database server

24 Web Site Security Encryption –SSL/TLS protocols for information exchange –Certificates for authenticating servers Security roles for authenticating clients –Assigning different levels of access Change inventory View salaries Change salaries Inventory Role HR Role Manager Role

25 Tools We will be Using JSP: –Jakarta Tomcat web container –Java programming language –NetBeans IDE –MySQL database server ASP: –Microsoft Visual Studio All are free downloads (see textbooks)

26 Background Knowledge Java or C++ (for JSP) –May want to get Java reference –I will cover basics in class Visual Basic or C# (for ASP) –Basics covered in class –If more familiar with C# can get corresponding text Basic html (including forms and tables) –Chapter 4 of text Basic SQL

27 Assignments Short programming assignments in core areas –Java Server Pages –Validation/redirection servlets –Session handling –Active Server Pages 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 manipulation AJAX Security… –Can use either JSP or ASP –Can be group project

The NetBeans IDE Integrated Development Environment for Java Programming –Editing code (with hints) –Compiling code –Running code Good for JSP/servlet development –Comes with own copy of Java, Tomcat –Allows easy development of web applications MS Visual Studio corresponding IDE for ASP

Downloading NetBeans

Downloading NetBeans

Note: NetBeans has built-in Tomcat server (must download Java EE version)

Creating a Web Application In NetBeans: File  New Project Choose Web and Web Application

Creating a Web Application Give your project a name (I called this one “WidgetSite”) Give it a location (I have put it in a directory called 6962) Make sure it is set as the Main Project

Creating a Web Application The final page shows information (such as which server this project uses) Can change to external server if desired

Creating a Web Application NetBeans creates an initial web site Structure shown in the project window Creates an initial index.jsp page (default home page of the new site) The index.jsp is initially just a “Hello world” page

Running a Web Application Running the site opens the index.jsp page

Building a Web Application Modify and add files to create web site index.jsp Prompts user for number of widgets reciept.jsp Displays number of widgets purchased

Building a Web Application

Adding a JSP File  New Choose a JSP Give it a name

Running the Site Compiles and runs current webapp (starting Tomcat and opening browser)