10/20/2015 ©2006 Scott Miller, University of Victoria 1 Alternative Content Distribution Methods Non-CGI/SSI Content Serving.

Slides:



Advertisements
Similar presentations
Languages for Dynamic Web Documents
Advertisements

Copyright 2004 Monash University IMS5401 Web-based Systems Development Topic 2: Elements of the Web (g) Interactivity.
JSP: JavaServer Pages Juan Cruz Kevin Hessels Ian Moon.
28/1/2001 Seminar in Databases in the Internet Environment Introduction to J ava S erver P ages technology by Naomi Chen.
Lecture 2 Web application architecture. Themes Architecture : The large scale structure of a system, especially a computer system Design choice: The need.
Active X Microsoft’s Answer to Dynamic Content Reference: Using Active X by Brian Farrar QUE
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.
Definitions, Definitions, Definitions Lead to Understanding.
Website Development with PHP and MySQL Introduction.
Java Server Team 8. Overview What is a Java Server? History Architecture Advantages Disadvantages Current Technologies Conclusion.
1 Java Server Pages Can web pages be created specially for each user? What part does Java play?
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.
Understanding and Managing WebSphere V5
CGI Programming Languages Web Based Software Development July 21, 2005 Song, JaeHa.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
Server-side Technologies
Overview of JSP Technology. The need of JSP With servlets, it is easy to – Read form data – Read HTTP request headers – Set HTTP status codes and response.
DAT602 Database Application Development Lecture 15 Java Server Pages Part 1.
Sys Prog & Scripting - HW Univ1 Systems Programming & Scripting Lecture 15: PHP Introduction.
INTRODUCTION TO WEB DATABASE PROGRAMMING
Applets & Servlets.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
CIS 285 ROBINSON WINTER 2005 CIS 285 Web Application Development with Java CIS 285 Sinclair Community College Instructor: Mary Robinson.
About Dynamic Sites (Front End / Back End Implementations) by Janssen & Associates Affordable Website Solutions for Individuals and Small Businesses.
Java Omar Rana University of South Asia. Course Overview JAVA  C/C++ and JAVA Comparison  OOP in JAVA  Exception Handling  Streams  Graphics User.
Web Server.
Chapter 17 - Deploying Java Applications on the Web1 Chapter 17 Deploying Java Applications on the Web.
Java support for WWW Babak Esfandiari (sources: Qusay Mahmoud, Roger Impey, textbook)
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
1 In the good old days... Years ago… the WWW was made up of (mostly) static documents. –Each URL corresponded to a single file stored on some hard disk.
10/6/2015 ©2007 Scott Miller, University of Victoria 1 2a) Systems Introduction to Systems Introduction to Software Systems Rev. 2.0.
10/13/2015 ©2006 Scott Miller, University of Victoria 1 Content Serving Static vs. Dynamic Content Web Servers Server Flow Control Rev. 2.0.
Creating Dynamic Web Pages Using PHP and MySQL CS 320.
Putting it all together Dynamic Data Base Access Norman White Stern School of Business.
Webcommerce Computer Networks Webcommerce by Linnea Reppa Douglas Martindale Lev Shalevich.
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
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.
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
® IBM Software Group © 2007 IBM Corporation Best Practices for Session Management
Copyright © 2002 ProsoftTraining. All rights reserved. JavaServer Pages.
Web Technologies Interactive Responsiveness Function Hypertext Web E-Publishing Simple Response Web Fill-in Forms Object Web « Full-Blown » Client/Server.
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.
David Lawrence 7/8/091Intro. to PHP -- David Lawrence.
An Introduction to JavaServer™ Pages Prepared by Nicole Swan.
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.
Middleware 3/29/2001 Kang, Seungwoo Lee, Jinwon. Description of Topics 1. CGI, Servlets, JSPs 2. Sessions/Cookies 3. Database Connection(JDBC, Connection.
Web Design and Development. World Wide Web  World Wide Web (WWW or W3), collection of globally distributed text and multimedia documents and files 
Module: Software Engineering of Web Applications Chapter 2: Technologies 1.
CS562 Advanced Java and Internet Application Introduction to the Computer Warehouse Web Application. Java Server Pages (JSP) Technology. By Team Alpha.
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.
ICM – API Server & Forms Gary Ratcliffe.
Introduction and Principles Web Server Scripting.
ASP-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
PHP: Further Skills 02 By Trevor Adams. Topics covered Persistence What is it? Why do we need it? Basic Persistence Hidden form fields Query strings Cookies.
CS122B: Projects in Databases and Web Applications Spring 2017
CS122B: Projects in Databases and Web Applications Winter 2017
Introduction Servlets and JSP
WWW and HTTP King Fahd University of Petroleum & Minerals
PHP / MySQL Introduction
MSIS 655 Advanced Business Applications Programming
Chapter 27 WWW and HTTP.
CS122B: Projects in Databases and Web Applications Winter 2018
Lecture 1: Multi-tier Architecture Overview
Introduction to Servlets
CS122B: Projects in Databases and Web Applications Spring 2018
Presentation transcript:

10/20/2015 ©2006 Scott Miller, University of Victoria 1 Alternative Content Distribution Methods Non-CGI/SSI Content Serving

10/20/2015 ©2006 Scott Miller, University of Victoria 2 CGI, SSI Building Blocks All alternative content serving methods use principles of CGI and SSI CGISSI ISAPI/ NSAPI Servlets Fast CGI JSP ASP.Net C# ASP Cold Fusion PHP

10/20/2015 ©2006 Scott Miller, University of Victoria 3 Alternatives - #1 Give programmers an API to build custom plug- ins and extensions to the web server –MS ISS: ISAPI DLLs –Netscape: NSAPI library/DLL Pros: Extremely efficient Cons: –API is difficult to learn –Only portable to specific server software –Extensions can compromise stability of server

10/20/2015 ©2006 Scott Miller, University of Victoria 4 Alternatives - #2 Keep CGI program running and send it multiple requests rather than starting/terminating a process each request –Fast CGI Pros: Helps compensate for inefficiencies of CGI Cons: Still has other issues with CGI –Poor content/presentation separation –Better scaling, but still not great

10/20/2015 ©2006 Scott Miller, University of Victoria 5 Alternatives - #3 Add extra features into SSI –Conditionals –Iterations –Native Database support Cold Fusion.cfm Active Server Pages (ASP).asp PHP.php Pros: –Dynamic content generated with minimal programming. –Scripting languages easy to learn Cons: –Programs are embedded in HTML and tend to be very procedural (not OOP); hard to re-use code –Not very efficient (~20 concurrent users)

10/20/2015 ©2006 Scott Miller, University of Victoria 6 Summary – So Far… Motivation –We want to improve the efficiency of CGI/SSI –We want better separation of content and presentation Ideas: –#1: API to the web server –#2: Keep CGI process running –#3: Improve SSI by adding procedural capabilities

10/20/2015 ©2006 Scott Miller, University of Victoria 7 Summary – So Far… These solutions don’t solve everything! –Content vs. Presentation still an issue in most of these solutions –API has security, stability and steep learning curve –Efficiency still isn’t very high for SSI based attempts

10/20/2015 ©2006 Scott Miller, University of Victoria 8 Alternatives - #4 Use an object-oriented, multi-threaded, portable language with a standard library for web applications JAVA! –javax.servlet package; servlet ≡ server-side applet Servlets run in a java process which connects to the web server via a “servlet engine” –E.g. Apache Tomcat

10/20/2015 ©2006 Scott Miller, University of Victoria 9 Alternatives - #4 Web Server Servlet Engine Java classes implementing javax.servlet API C1C2 Plug-in for various web servers Tomcat, IBM WebSphere, etc. Each servlet is an instance of a Java class

10/20/2015 ©2006 Scott Miller, University of Victoria 10 Servlet Approach Pros: –Scalable (multithreaded) –Reusable (OOP) –Internalization (working with different locales inputs – currency, character sets, encodings, etc.) –Very clean, elegant coding model (Java) –Tables in relational databases can be abstracted by Java objects (direct manipulation through Java) Cons: –Still write HTML as output

10/20/2015 ©2006 Scott Miller, University of Victoria 11 Alternatives - #5 Embed powerful programming language into HTML like SSI –Java Server Pages (JSP).jsp Use special tags to embed java into HTML so advanced programming can be used JSPs are compiled into servlets –First compilation: slow –Subsequent executions without needing re- compilations: extremely fast

10/20/2015 ©2006 Scott Miller, University of Victoria 12 What now? Now we know the basics to dynamic web applications –Web server creates the HTTP request context and passes it to another program –External program generates dynamic HTML as output and sets cookies in HTML headers These principles can be used towards any web application technology Many technologies use similar structures, so once you learn one, you can use the other –JSP & ASP, etc.

10/20/2015 ©2006 Scott Miller, University of Victoria 13 Web Browsers Responsibilities Architecture Rev 2.0

10/20/2015 ©2006 Scott Miller, University of Victoria 14 Web Browsers One specific (most used) client for HTTP Many different “flavours”of browser –Useful to keep in mind as “universal” applications don’t work the same on each browser platform –Sent in “User-Agent” header Very object-oriented design

10/20/2015 ©2006 Scott Miller, University of Victoria 15 How do we design a client? Generate and send HTTP requests to web servers in response to: –Typing a URL into the location field –Clicking on a Hyperlink –Clicking ‘refresh’ –“SUBMIT” action on a form – Embedded objects in the HTML Accept HTTP responses from servers and process the headers Render the body of response in window –Parse HTML –Parse additional content (.jpg,.gif, video, etc.)

10/20/2015 ©2006 Scott Miller, University of Victoria 16 Very High Level Flow User Requests Resource Browser Generates Request User enters URL, etc. GUI processes action Internal Request Module Server Processin g Browser Receives Response Internal Parsing Modules Object (HTML,.jpg) Rendering Browser Displays Resource User sees pretty page

10/20/2015 ©2006 Scott Miller, University of Victoria 17 More Responsibilities Caching –Do I keep a copy in local storage? Do I already have it there? Authentication –How do I prompt for a username and password? How do I store them for future use? State Maintenance –How do I deal with cookies? Embedded Objects –Do I request them automatically?

10/20/2015 ©2006 Scott Miller, University of Victoria 18 More Responsibilities HTTP Processing –Do I implement ALL status codes? Do I properly use headers? –Need to FULLY understand/implement full HTTP specifications External Processing/Plug-ins –Can I support complex objects? Do I support plug-ins for 3 rd party media? Network Subsystem –Do I know how to deal with TCP, errors, etc.?

10/20/2015 ©2006 Scott Miller, University of Victoria 19 System Level Look (Fig 5.3) GUI CachingAuthenticationCookies Config Request Generator Networking Get File System Request

10/20/2015 ©2006 Scott Miller, University of Victoria 20 System Level Look (Fig 5.3) GUI CachingCookies Config Networking File System Response Request Generator Content Decoders HTML Renderer Response Processor Set

10/20/2015 ©2006 Scott Miller, University of Victoria 21 Items to Consider Browser architecture is HIERARCHY –Remember “systems” – “A uses B” MIME Types –Determines what “content rendering mechanism” to use Each request/response is one full cycle. Networking doesn’t take place in between File System involved – there is data to worry about saving to hard disk space

10/20/2015 ©2006 Scott Miller, University of Victoria 22 Persistent Data Rules (Table 5.1) DecisionAccess KeyDelete? CachingResponse Headers and User Settings URLExpiry Date OR Cache Full CookiesUser SettingsDomain and Path Expiry Date OR End of Session Authorization Credentials Always store them Server & Realm End of Session

10/20/2015 ©2006 Scott Miller, University of Victoria 23 Advanced Ideas POST method –Sends data (e.x. upload picture) through body of request; multipart messages –Send remote code calls for remote applications over HTTP; Remote Procedure Calls

10/20/2015 ©2006 Scott Miller, University of Victoria 24 Multipart Message Example … Content-Type: multipart/form-data; boundary=“23tagDSFoj346189F2” --23tagDSFoj346189F2 Content-Type: application/x-www-form-urlencoded &filename=….&param=value --23tagDSFoj346189F2 Content-Type: image/gif Content-Transfer-Encoding: base64 FsZCB23oYXfy432Faate223GdsgY …

10/20/2015 ©2006 Scott Miller, University of Victoria 25 Reading for Next Class Get finished with Lab 2 Decide on your Lab 3/4 project! NEXT CLASS: EXAMPLES OF WEB LANGUAGES AND HTML