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.

Slides:



Advertisements
Similar presentations
Lecture 11 Server Side Interaction
Advertisements

Lecture plan Information retrieval (from week 11)
DT228/3 Web Development WWW and Client server model.
PHP/ASP Robert Nelson & Will Vanlue BA370 November 4 th, 2005.
Web Server Hardware and Software
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.
Kashif Jalal CA-240 (072) Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 2 of…
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic Server Side Web Technologies: Part 1.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic Server Side Web Technologies: Part 2.
DT211/3 Internet Development Application Internet Development Application.
Active Server Pages Chapter 1. Introduction Understand how browsers and servers interacted when the Web was young Understand what early Internet and intranet.
Java Server Team 8. Overview What is a Java Server? History Architecture Advantages Disadvantages Current Technologies Conclusion.
Java Server and Servlet CS616 Team 9 Kim Doyle, Susan Kroha, Arunima Palchowdhury, Wei Xu.
SE-2840 Dr. Mark L. Hornick1 Java Servlet-based web apps Servlet Architecture.
Chapter 6: Hostile Code Guide to Computer Network Security.
Java Servlets. What Are Servlets? Basically, a java program that runs on the server Basically, a java program that runs on the server Creates dynamic.
Apache Jakarta Tomcat Suh, Junho. Road Map Tomcat Overview Tomcat Overview History History What is Tomcat? What is Tomcat? Servlet Container.
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.
The PHP Story. PHP Story PHP is a programming language. Incorporate(join) sophisticated business logic. Widely used general purpose scripting language.
TOPIC 1 – SERVER SIDE APPLICATIONS IFS 234 – SERVER SIDE APPLICATION DEVELOPMENT.
Server-side Technologies
Server Side Scripting Norman White. Where do we do processing? Client side – Javascript (embed code in html) – Java applets (send java program to run.
Sys Prog & Scripting - HW Univ1 Systems Programming & Scripting Lecture 15: PHP Introduction.
INTRODUCTION TO WEB DATABASE PROGRAMMING
Applets & Servlets.
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.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Introduction to ASP.NET. Prehistory of ASP.NET Original Internet – text based WWW – static graphical content  HTML (client-side) Need for interactive.
AIT 616 Fall 2002 PHP. AIT 616 Fall 2002 PHP  Special scripting language used to dynamically generate web documents  Open source – Free!!!  Performs.
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.
CIS 451: Servers, CGI and Log Files Dr. Ralph D. Westfall January, 2009.
Introduction to Internet Programming (Web Based Application)
11/16/2012ISC329 Isabelle Bichindaritz1 Web Database Application Development.
Chapter 17 - Deploying Java Applications on the Web1 Chapter 17 Deploying Java Applications on the Web.
Java CGI Lecture notes by Theodoros Anagnostopoulos.
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.
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
1 CS122B: Projects in Databases and Web Applications Spring 2015 Notes 03: Web-App Architectures Professor Chen Li Department of Computer Science CS122B.
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
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.
ECMM6018 Enterprise Networking for Electronic Commerce Tutorial 7
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.
Fall 2000C.Watters1 World Wide Web and E-Commerce Servers & Server Side Processing.
Introduction and Principles Web Server Scripting.
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.
UMass Lowell Computer Science Java and Distributed Computing Prof. Karen Daniels Fall, 2000 Lecture 21 Java Servlets Wed. 11/22/00 based on material.
Java Servlets and Java Server Pages
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.
Introduction to ASP.NET development. Background ASP released in 1996 ASP supported for a minimum 10 years from Windows 8 release ASP.Net 1.0 released.
Fall 2000C.Watters1 World Wide Web and E-Commerce Servers & Server Side Processing.
Presented By Sushil K. Chaturvedi Assistant Professor SRCEM,Banmore 1.
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.
CS122B: Projects in Databases and Web Applications Spring 2017
CS122B: Projects in Databases and Web Applications Winter 2017
WWW and HTTP King Fahd University of Petroleum & Minerals
PHP / MySQL Introduction
Web Development Using ASP .NET
CS122B: Projects in Databases and Web Applications Winter 2018
Introduction to Servlets
CS122B: Projects in Databases and Web Applications Spring 2018
Web Application Development Using PHP
Presentation transcript:

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 that can be run dynamically from a Web Server Servlets are a server-side technology Servlets are a server-side technology A Servlet is an intermediating layer between an HTTP request of a client and the Web server A Servlet is an intermediating layer between an HTTP request of a client and the Web server

3 What is a Servlet?  Java’s answer to the Common Gateway Interface (CGI).  Applet: a java program that runs within the web browser.  Servlet: a java program that runs within the web server.  One standard for building web applications.

4 A Java Servlet Web browser Web server request response Servlet

5 What do Servlets do? Read data sent by the user (e.g., form data)Read data sent by the user (e.g., form data) Look up other information about the request in the HTTP request (e.g. authentication data, cookies, etc.)Look up other information about the request in the HTTP request (e.g. authentication data, cookies, etc.) Generate the result (may do this by talking to a database, file system, etc.)Generate the result (may do this by talking to a database, file system, etc.) Format the result in a document (e.g., make it into HTML)Format the result in a document (e.g., make it into HTML) Set the appropriate HTTP response parameters (e.g. cookies, content-type, etc.)Set the appropriate HTTP response parameters (e.g. cookies, content-type, etc.) Send the document to the userSend the document to the user

6 Some example applications  Search Engines  Personalization Systems  E-Commerce Applications  Shopping Carts  Product Catalogs  Intranet Applications  Groupware Applications: bulletin boards, file sharing, etc.

7 Other Server Side Options  Mod Perl  ASP  PHP  Cold Fusion  Python .NET  More…..

8 Common Features  All server side frameworks share a common set of features:  Read data submitted by the user  Generate output dynamically based on user input  Determine information about the client e.g. browser. etc.  Access Database systems  Exploit the HTTP protocol

9 Option CGI scripting  Represents one of the earliest, practical methods for generating web content.  Primarily written in the Perl programming language.  Unfortunately, traditional CGI programs suffer from scalability and performance problems.  Let’s examine these two problems…

10 CGI 1) Browser initiates request 2) Web server receives the request. 3) For each request, web server spawns a new operating system process to execute the CGI/Perl Program. Web Browser Web Server Perl/CGI Create New process

11 Problem – SCALE!  For each browser request, the web server must spawn a new operating system process. Browser 1 Web Server Perl 1 Browser 2 Browser N Perl 2 Perl N

12 CGI Scripting  Spawning a new operating system process for each request takes time and memory.  Hence, traditional CGI programs have inherent performance and scalability problems.  Every other server architecture tries to address these problems.

13 Option : Mod Perl  A module of the Apache Web Server.  Embeds the Perl interpreter directly within the web server.  Because Perl is embedded within the Server, Mod Perl does not need to create a new process for each request.  Mod Perl is much faster than traditional CGI.  For more information, see:

14 Option: ASP  Active Server Pages  Runs on Microsoft’s Web Server: Internet Information Server (IIS)  Programmers add ASP code directly into their HTML pages.  When a client requests a page, the Web Server takes the HTML page, runs the ASP code within the page, and returns a complete HTML page.  Faster than traditional CGI, but only(?) works on Microsoft IIS.

15 Option : Cold Fusion  Developed by Allaire Corporation (now owned by Macromedia.)  Provides excellent database access and database tools.  Great platform for rapid prototyping and rapid development.  For more information:

16 Option : PHP  An open source project written entirely by volunteers  Provides simple, but powerful database access.  Also great for rapid development.  For additional information:

17 Decision Points  When evaluating which server side framework to use, you need to consider a number of critical factors:  Ease of development:  How easily can you build new applications?  Performance:  How fast can the framework respond to queries?  Scalability:  Can the framework scale to thousands, millions of users?  Security:  Are there any inherent security vulnerabilities?

18 Advantages of Servlets  Very clean, elegant interface  Built-in Security  Fast Performance  Object Oriented  Exception Handling  Cross-Platform  Scalable to very large audiences

19 Advantages of Servlets  Servlets have six main advantages:  Efficient  Convenient  Powerful  Portable  Secure  Inexpensive

20 Servlet: Efficient  For each browser request, the servlet spawns a light weight thread.  This is faster and more efficient that spawning a new operating system process.  Hence, servlets have better performance and better scalability than traditional CGI.

21 Servlet: Convenient  Servlets include built-in functionality for:  Reading HTML form data  Handling cookies  Tracking user sessions  Setting HTTP headers  Java is object oriented

22 Servlet: Powerful  Servlets can talk directly to the web servers.  Multiple servlets can share data:  Particularly important for maintaining database connections.  Includes powerful techniques for tracking user sessions.

23 Servlet: Portable  One of the advantages of Java is its portability across different operating systems.  Servlets have the same advantages.  You can therefore write your servlets on Windows, then deploy them on UNIX.  You can also run any of your servlets on any Java-enabled web server, with no code changes.

24 Servlet: Secure  Traditional CGI programs have a number of known security vulnerabilities.  Hence, you usually need to include a separate Perl/CGI module to supply the necessary security protection.  Java has a number of built-in security layers.  Hence, servlets are considered more secure than traditional CGI programs.

25 Servlet: Inexpensive  You can download free servlet kits for development use.  You can therefore get started for free!  Nonetheless, production strength servlet web servers can get quite expensive.

26 Why Not?  Run in container…more management, complexity, debugging  Performance dependent on container  Psuedo-compiled ….speed compared to compiled programs  Everything an object – overhead?