_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.

Slides:



Advertisements
Similar presentations
Lecture plan Information retrieval (from week 11)
Advertisements

DT228/3 Web Development WWW and Client server model.
Languages for Dynamic Web Documents
Copyright 2004 Monash University IMS5401 Web-based Systems Development Topic 2: Elements of the Web (g) Interactivity.
Servlets and a little bit of Web Services Russell Beale.
15 Chapter 15 Web Database Development Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel.
INTERNET DATABASE Chapter 9. u Basics of Internet, Web, HTTP, HTML, URLs. u Advantages and disadvantages of Web as a database platform. u Approaches for.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic Server Side Web Technologies: Part 1.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 34 Servlets.
DT211/3 Internet Development Application Internet Development Application.
INTERNET DATABASE. Internet and E-commerce Internet – a worldwide collection of interconnected computer network Internet – a worldwide collection of interconnected.
Introduction to Web Interface Technology (CSE2030)
Introduction to Web Based Application. Web-based application TCP/IP (HTTP) protocol Using WWW technology & software Distributed environment.
Active Server Pages Chapter 1. Introduction Understand how browsers and servers interacted when the Web was young Understand what early Internet and intranet.
Apache Tomcat Server Typical html Request/Response cycle
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.
Java Server and Servlet CS616 Team 9 Kim Doyle, Susan Kroha, Arunima Palchowdhury, Wei Xu.
Gayle J Yaverbaum, PhD Professor of Information Systems Penn State Harrisburg.
Web-based Software Development - An introduction.
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
Sys Prog & Scripting - HW Univ1 Systems Programming & Scripting Lecture 15: PHP Introduction.
1 Web Database Processing. Web Database Applications Static Report Publishing a report is prepared from a database application and exported to HTML DB.
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
INTRODUCTION TO WEB DATABASE PROGRAMMING
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
1 Servlet How can a HTML page, displayed using a browser, cause a program on a server to be executed?
CSCI 6962: Server-side Design and Programming Course Introduction and Overview.
Introduction to ASP.NET. Prehistory of ASP.NET Original Internet – text based WWW – static graphical content  HTML (client-side) Need for interactive.
Databases and the Internet. Lecture Objectives Databases and the Internet Characteristics and Benefits of Internet Server-Side vs. Client-Side Special.
Week 7 Lecture Web Database Development Samuel Conn, Asst. Professor
Chapter 33 CGI Technology for Dynamic Web Documents There are two alternative forms of retrieving web documents. Instead of retrieving static HTML documents,
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.
About Dynamic Sites (Front End / Back End Implementations) by Janssen & Associates Affordable Website Solutions for Individuals and Small Businesses.
Introduction to Internet Programming (Web Based Application)
11/16/2012ISC329 Isabelle Bichindaritz1 Web Database Application Development.
Fundamentals of Database Chapter 7 Database Technologies.
20-753: Fundamentals of Web Programming 1 Lecture 1: Introduction Fundamentals of Web Programming Lecture 1: Introduction.
Web Server Programming 1. Nuts and Bolts. Premises of Course Provides general introduction, no in-depth training Assumes some HTML knowledge Assumes some.
Putting it all together Dynamic Data Base Access Norman White Stern School of Business.
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
Active Server Pages  In this chapter, you will learn:  How browsers and servers interacted on the Internet when the Internet first became popular 
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
Chapter 6 Server-side Programming: Java Servlets
1 Welcome to CSC 301 Web Programming Charles Frank.
1 CS122B: Projects in Databases and Web Applications Spring 2015 Notes 03: Web-App Architectures Professor Chen Li Department of Computer Science CS122B.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 14 Database Connectivity and Web Technologies.
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
Server-side Programming The combination of –HTML –JavaScript –DOM is sometimes referred to as Dynamic HTML (DHTML) Web pages that include scripting are.
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
ASP (Active Server Pages) by Bülent & Resul. Presentation Outline Introduction What is an ASP file? How does ASP work? What can ASP do? Differences Between.
1 Java Servlets l Servlets : programs that run within the context of a server, analogous to applets that run within the context of a browser. l Used to.
Web Technologies Lecture 8 Server side web. Client Side vs. Server Side Web Client-side code executes on the end-user's computer, usually within a web.
Java for networking Module Introduction Data Communications Communication architecture Application.
Middleware 3/29/2001 Kang, Seungwoo Lee, Jinwon. Description of Topics 1. CGI, Servlets, JSPs 2. Sessions/Cookies 3. Database Connection(JDBC, Connection.
CSI 3125, Preliminaries, page 1 SERVLET. CSI 3125, Preliminaries, page 2 SERVLET A servlet is a server-side software program, Responds oriented other.
1 Introduction to Servlets. Topics Web Applications and the Java Server. HTTP protocol. Servlets 2.
JS (Java Servlets). Internet evolution [1] The internet Internet started of as a static content dispersal and delivery mechanism, where files residing.
Fall 2000C.Watters1 World Wide Web and E-Commerce Servers & Server Side Processing.
WEB SERVER SOFTWARE FEATURE SETS
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 14 Database Connectivity and Web Technologies.
UMass Lowell Computer Science Java and Distributed Computing Prof. Karen Daniels Fall, 2000 Lecture 21 Java Servlets Wed. 11/22/00 based on material.
How CGI and Java Servlets are Run By David Stein 14 November 2006.
Bayu Priyambadha, S.Kom. Static content  Web Server delivers contents of a file (html) 1. Browser sends request to Web Server 3. Web Server sends HTML.
Fall 2000C.Watters1 World Wide Web and E-Commerce Servers & Server Side Processing.
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.
Servlet Fudamentals.
Chapter 26 Servlets.
Introduction to Servlets
Objectives In this lesson you will learn about: Need for servlets
CS122B: Projects in Databases and Web Applications Winter 2019
Presentation transcript:

_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1  Wiley and the book authors 2001 E-Commerce: Fundamentals and Applications Chapter 4 : Server-Side Programming I Servlet Fundamentals

_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications2  Wiley and the book authors 2001 Outline Common server-side programming techniques Basic concepts of Java Servlets - an innovative server-side programming technology Advantages of servlets over other technologies for developing Web-based applications Simple Java servlet programs

_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications3  Wiley and the book authors 2001 Revisiting the Three-tier Model Web-based e-commerce applications are usually built according to the “Three-tier Model” (Fig. 4.1), which includes: The First-tier: Web Client  Discussed in Chapter 3 The Second-tier: Server-side Application (SSA)  Discussed in this chapter The Third-tier: Database Management Systems (DBMS)  Discussed in Chapter 5

_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications4  Wiley and the book authors 2001 Three-Tier Model (Fig. 4.1) Database Cluster Client Browser First-tier : Web Clients Second-tier : Server-side Web Applications Web Server Application Server Third-tier (DBMS) : Database Cluster(s) SQL Server Other databases Oracle databases DB2 databases Internet Database Connectivity

_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications5  Wiley and the book authors 2001 Server-side programming technologies There are numerous ways to implement server- side applications. Common examples include: CGI (Common Gateway Interface) ASP (Active Server Page) Java Servlets

_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications6  Wiley and the book authors 2001 Common Gateway Interface (CGI) Early Web page designs were “static” in the sense that a client can only request for a static HTML document from the Web server (Fig. 4.2). Later, CGI programming techniques were introduced to remove this constraint by providing dynamic Web pages via server-side interaction, as shown in Fig. 4.3.

_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications7  Wiley and the book authors 2001 Static Web Page Retrieval (Fig. 4.2)  HTTP Request  HTTP Document  Retrieve Document  Request for Web Document Web Documents Web Browser Web Server

_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications8  Wiley and the book authors 2001 CGI-based Web Application (Fig. 4.3)  Get Data  HTTP Request  HTTP Document  Output (HTML)  HTML forms to invoke CGI scripts CGI Scripts/ Applications Web Browser Web Server Database  Return data

_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications9  Wiley and the book authors 2001 Common Gateway Interface (CGI) Fig. 4.3 explains the retrieval of a static Web page. The Web browser goes to the designated URL on a specific Web server to retrieve the required static HTML document when it receives a client request. Note the content is independent of the request, in the sense, everyone who makes a request to that particular URL gets the same document.

_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications10  Wiley and the book authors 2001 Active Server Page (ASP) ASP is a "scripting" technique that runs on Web servers rather than Web clients.This contrasts with VBScript and JavaScript which run on web clients. It basically generates HTML documents for the Web client. Execution of the ASP code by the server returns the corresponding HTML document to the client. Fig. 4.4 shows the schematic diagram of ASP model.

_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications11  Wiley and the book authors 2001 ASP Model (Fig. 4.4) ASP Engine  HTTP Request  HTTP Document Web Browser Web Server Database

_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications12  Wiley and the book authors 2001 Disadvantages of CGI programs Each new request activates a new process to run the CGI program Creating a process requires time and resource so CGI programs is not as scaleable a solution Also, CGI programs may raise security problems.

_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications13  Wiley and the book authors 2001 Java Servlet A servlet is a small piece of server-side application, which can be viewed as the server- side analog of an applet. In a typical servlet application, a servlet-enabled Web server receives an HTTP request from the client. It then forwards the request to the servlet engine for performing the necessary operations as specified by the program. Finally it returns a response (e.g., HTML document) to the client via the Web server (Fig. 4.5)

_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications14  Wiley and the book authors 2001 Typical Web-based Servlet Interaction (Fig. 4.5) Servlet Engine HTTP Request HTTP Response Web Browser Web Server Database

_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications15  Wiley and the book authors 2001 Why using Servlets? In this book, they cover a solution called Java servlet for three reasons:  it is more effective and efficient  it is more secure  it contains a lot of standard libraries ("do not need to reinvent the wheel") Effectively, Java servlet does what CGI programs do but simpler, more efficient and more secure

_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications16  Wiley and the book authors 2001 How to run servlets? To run servlets, there are TWO options: To use a servlet-enabled Web server, i.e. a Web server that can support the servlet APIs directly. To use a "plug-in" servlet engine in a non-servlet- enabled Web server.

_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications17  Wiley and the book authors 2001 Generic vs. HTTP Servlet Model The Java servlet API has two main packages, namely javax.Servlet and javax.Servlet.http.  The javax.Servlet package consists of interfaces and classes that can be implemented and used by all servlets by overriding service() method - Generic Servlets.  The javax.Servlet.http package are for HTTP-specific servlets. Hence it is mainly used for building Web- based applications by overriding doPost()/doGet() methods - HTTP Servlets.

_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications18  Wiley and the book authors 2001 Methods to create HTTP servlets Besides the doGet() and doPost() methods, a variety of methods corresponding to different HTTP commands are available (see Table 4.3 in the book). Essentially, these methods allow a servlet to perform actions according to the type of HTTP request received.

_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications19  Wiley and the book authors 2001 Building the Virtual Bookstore (VBS) We will demonstrate how to build a simple Virtual Bookstore (VBS) by using Java servlets as the core server-side programming tool, which include:  Client-side programming using HTML and JavaScript in Chapter 3.  Server-side programming using Java servlets in this Chapter 4-6.  JDBC programming with servlets to implement database connectivity, in Chapter 5.  Session tracking technique using the servlet session tracking API to implement user login and shopping cart applications, in Chapter 6.