Server-side Technologies

Slides:



Advertisements
Similar presentations
DT228/3 Web Development WWW and Client server model.
Advertisements

Java Servlet & JSP © copyright 2005 SNU OOPSLA Lab.
DT211/3 Internet Application Development Active Server Pages & IIS Web server.
Copyright 2004 Monash University IMS5401 Web-based Systems Development Topic 2: Elements of the Web (g) Interactivity.
Server-Side vs. Client-Side Scripting Languages
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.
28/1/2001 Seminar in Databases in the Internet Environment Introduction to J ava S erver P ages technology by Naomi Chen.
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.
Introduction to Web Application Architectures Web Application Architectures 18 th March 2005 Bogdan L. Vrusias
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)
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 Team 8. Overview What is a Java Server? History Architecture Advantages Disadvantages Current Technologies Conclusion.
Introduction to Servlet & JSP
Comp2513 Java Servlet Basics Daniel L. Silver, Ph.D.
1 Java Server Pages Can web pages be created specially for each user? What part does Java play?
Java Server and Servlet CS616 Team 9 Kim Doyle, Susan Kroha, Arunima Palchowdhury, Wei Xu.
Servlets Compiled by Dr. Billy B. L. Lim. Servlets Servlets are Java programs which are invoked to service client requests on a Web server. Servlets extend.
Servlets. Our Project 3-tier application Develop our own multi-threaded server Socket level communication.
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.
Gayle J Yaverbaum, PhD Professor of Information Systems Penn State Harrisburg.
Introduction Servlets and JSP Celsina Bignoli
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.
1 Servlet How can a HTML page, displayed using a browser, cause a program on a server to be executed?
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Week 7 Lecture Web Database Development Samuel Conn, Asst. Professor
Introduction to JAVA Instructor : Simon Hui & Louis Wong Industrial Centre The Hong Kong Polytechnic University Sep, 2002.
Introduction to Internet Programming (Web Based Application)
Java support for WWW Babak Esfandiari (sources: Qusay Mahmoud, Roger Impey, textbook)
Web Server Programming 1. Nuts and Bolts. Premises of Course Provides general introduction, no in-depth training Assumes some HTML knowledge Assumes some.
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
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.
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)
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
ASP.NET in Definition: 1.ASP.NET is a web application framework developed and marketed by Microsoft to allow programmers to build dynamic web sites,
Java Servlets and Java Server Pages Norman White Stern School of Business.
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.
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.
JS (Java Servlets). Internet evolution [1] The internet Internet started of as a static content dispersal and delivery mechanism, where files residing.
CSI 3125, Preliminaries, page 1 SERVLET. CSI 3125, Preliminaries, page 2 SERVLET A servlet is a server-side software program, written in Java code, that.
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.
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.
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.
1 Web Programming with Servlets & JSPs WEB APPLICATIONS – AN OVERVIEW.
A S P. Outline  The introduction of ASP  Why we choose ASP  How ASP works  Basic syntax rule of ASP  ASP’S object model  Limitations of ASP  Summary.
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
Introduction Servlets and JSP
Servlet Fudamentals.
PHP / MySQL Introduction
CS122B: Projects in Databases and Web Applications Winter 2018
Introduction to Servlets
CS122B: Projects in Databases and Web Applications Spring 2018
CS122B: Projects in Databases and Web Applications Winter 2019
Presentation transcript:

Server-side Technologies Technologies that exist at the server side Where the real work occurs

Server-side Technologies Looking at …. Client-side scripting v Server-side scripting Factors in selecting a technology Older and New technologies CGI, Fast CGI, Mod Perl, Active Server Pages (ASP), Cold Fusion Overview of Servlets Introduction to Java Server Pages (JSP)

Client-side scripting v Server-side scripting Validates user input Accesses the browser Enhances Web pages with ActiveX® controls, applets, etc. Manipulates browser documents Client-side validation Reduces number of requests that need to be passed to server Client-side scripting limitations Browser dependency Viewable to users through View Source command JavaScript most popular client-side script

Client-side scripting v Server-side scripting Server-side scripts Provides programmers greater flexibility Generates custom responses for clients Contains greater programmatic capabilities than client-side equivalents Has access to server-side software that extend server functionality

Server-side options Common Gateway Interface (CGI) Fast CGI Mod Perl Active Server Pages (ASP) Personal Home Pages (PHP) Cold Fusion Java Servlets Java Server Page (JSP)

Common Features All server-side frameworks share a common set of features Read data submitted by the user Generate HTML dynamically based on user input Determine information about the client browser Access database systems Exploit the HTTP protocol

Decision Points When evaluating which server-side technology 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 technology respond to queries Scalability Can the technology scale to thousands, even millions of users? Security Are there any inherent security vulnerabilities?

Common Gateway Interface (CGI) CGI represents one of the earliest, practical methods for generating web content Primarily written in the Perl programming language Unfortunately, some CGI programs suffer from scalability and performance problems Let us see why this happens

CGI Architecture Browser initiates request Web server receives request For each new request, web server spawns a new operating system process to execute the CGI/Perl program Create new process Web Server Perl/CGI Browser

CGI Architecture For each browser request, the web server must spawn a new operating system process CGI/Perl 1 Browser 1 Web Server Browser 2 CGI/Perl 2 Browser N Create new process CGI/Perl N

CGI Architecture Spawning a new operating system process for each request takes time and memory Hence, CGI programs have inherent scalability and performance problems Almost all other server architectures address these problems

Fast CGI Developed by Open Market as an option for developing faster, more scalable CGI programs Works by creating a pool of processes for handling CGI requests When a server receives a CGI request, Fast CGI picks up one of the processes from the pool and assigns it to the task Without the overhead of creating new processes each time, Fast CGI is much quicker than traditional CGI

Mod Perl A module of the Apache Web server Embeds the Perl interpreter directly within the web server Perl programs are therefore precompiled Since Perl is embedded within the server, Mod Perl does not need to create a new process for each request Like Fast CGI, Mod Perl is much faster than traditional CGI

Server Extensions Several web servers provide extension APIs (Application Programming Interfaces) Netscape provides (NSAPI) Microsoft provides (ISAPA) Similar to Mod Perl, these programs run directly within the web server Hence, Server Extensions are much faster than traditional CGI Usually written in C/C++, they are not portable across web servers E.g. if you develop using Netscape NSAPI, you cannot run it on Microsoft ISAPA

ASP (Active Server Pages) Developed by Microsoft Runs on Microsoft’s web server: IIS (Internet Information Server) Developers add ASP code directly to 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 the result in another HTML page Faster than traditional CGI but only works with Microsoft’s IIS

Cold Fusion Developed by Allaire Corporation Provides excellent database access and tools Very good technology for Rapid Prototyping and Rapid development

PHP (Personal Home Pages) An open source project developed by volunteers Provides simple and powerful database access and tools Good for Rapid Application Development

Servlet Java’s answer to the CGI script Do not confuse a servlet with an applet Applet: a java program that runs within a browser Servlet: a java program that runs within a web server Rapidly becoming most popular technology for developing web based applications

Servlet Overview Servlets are a significant development in client/server computing for the web Java Servlet API – standard extension to Java Provides a Java class that can be loaded dynamically to expand the functionality of a Java-enabled server Does not require Java support on the client side

Servlet Overview Provides a generic mechanism for extending the functionality of any kind of server (not just web servers) e.g. could be used to extend the functionality of a Java-based ftp server, or a mail server to scan for viruses attached to email Makes it easier for applets to communicate with the server Created to solve one basic need recognised: Generating dynamic web content

History of Servlets In late 1996, the use of Java on the server side was developing Allows getting away from the use of sockets on the server side Software vendors were each developing their own approach Problem: each technology was tied to a particular vendor server program

History of Servlets Better to have a generic technology so that server programs could have the “write-once, run-anywhere” approach Early 1997, JavaSoft (Sun Microsystems) released the Servlet API Designed to work on Java and non-Java based servers Most web servers support Servlets

General mechanism Execute within the server’s process space Each servlet handled by a separate thread within the server process, not as separate processes (as in CGI). Servlets are portable across different web servers and different operating systems Fast, powerful and portable replacements to CGI scripts

General mechanism Persist between invocations (CGI scripts reloaded), resulting in significant performance benefits over CGI programs Servlets have full access to the Java APIs and also to third party component classes (e.g. database connections, etc.)

Places where Servlets can be used Accessed by name to generate a HTML page Embedded inside a HTML page as a server side include These are useful when a web page is mostly static info but contains small sections of dynamically-generated info Embedded inside a HTML page using Java Server Pages (JSP) – see these later

3 types of servlet engine Standalone Server that contains built in support for Servlets (e.g. Tomcat) Does not exist for many web servers Disadvantage: have to wait for a new server release to get latest servlet support Add-on A plug-in for an existing web server Many have been written for servers (e.g. Apache) Embedded Lightweight servlet platform that can be embedded in another application

Advantages of Servlets Servlets have 6 main advantages Efficient Convenient Powerful Portable Secure Inexpensive Let us see why

Advantages of Servlets Efficient For each browser request, the servlet spawns a light weight thread This is faster and more efficient than spawning a new operating system process Hence, servlets have better performance and scalability than traditional CGI

Advantages of Servlets Convenient Servlets include built-in functionality for: Reading HTML from data Handling cookies Tracking user sessions Setting HTTP headers Java is an object-oriented language which arguably can make development easier

Advantages of Servlets Powerful Servlets can talk directly to web servers Multiple servlets can share data Particularly important for maintaining database connections Includes powerful techniques for tracking user sessions

Advantages of Servlets Portable One of the advantages of Java is its portability across different operating systems Servlets have the same advantages (they are written in Java) Can be written on a Windows platform and run on a UNIX operating system Servlets can be run on any Java-enabled web server with no code changes

Advantages of Servlets Secure Traditional CGI programs have a number of known security vulnerabilities Hence, a separate CGI/Perl script is usually required to provide the extra security required Java itself has a number of built-in security features Therefore, Servlets are regarded to be more secure than CGI programs

Advantages of Servlets Inexpensive You can download free servlet kits for development As many servlets that are required can be developed for free and run on many free Java-enabled web servers

Servlets Example import javax.servlet.*; import javax.servlet.http.*; public class HelloWorld extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException response.setContentType("text/html"); PrintWriter out = response.getWriter(); out.println("<html>"); out.println("<body>"); out.println("<head>"); out.println("<title>Hello World!</title>"); out.println("</head>"); out.println("<h1>Hello World!</h1>"); out.println("</body>"); out.println("</html>"); }

Server Pages Microsoft IIS + ASP (Active Server Pages) Sun followed suit + JSP (JavaServer Pages)

Java Server Pages Related to Java servlets An extension of the Java servlet API Can be used alone or in conjunction with servlets Another method for developing server side applications We will look at these in more detail in next lecture

References Check out Fast CGI Mod Perl Active Server Pages (ASP) http://www.fastcgi.com Mod Perl http://perl.apache.org Active Server Pages (ASP) http://www.microsoft.com Cold Fusion http://www.allaire.com PHP http://www.php.net Servlet and Java Server Page (JSP) http://java.sun.com

Summary We have looked at: Client-side scripting v Server-side scripting Factors in selecting a technology Older and New technologies CGI, Fast CGI, Mod Perl, Active Server Pages (ASP), Cold Fusion Overview of Servlets Introduction to Java Server Pages (JSP)