Web & Web applications DBW 2017.

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.
Servlets and a little bit of Web Services Russell Beale.
Introduction to Web Interface Technology (CSE2030)
How Clients and Servers Work Together. Objectives Learn about the interaction of clients and servers Explore the features and functions of Web servers.
ECA 228 Internet/Intranet Design I Intro to the Web.
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.
Sys Prog & Scripting - HW Univ1 Systems Programming & Scripting Lecture 15: PHP Introduction.
INTRODUCTION TO WEB DATABASE PROGRAMMING
Computer Concepts 2014 Chapter 7 The Web and .
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?
Overview A plain HTML document is static A CGI program is executed in real-time, so that it can output dynamic information. CGI (Common Gateway Interface)
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
CP3024 Lecture 3 Server Side Facilities. Lecture contents  Server side includes  Common gateway interface (CGI)  PHP Hypertext Preprocessor (PHP) pages.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
HTTP; The World Wide Web Protocol
Comp2513 Forms and CGI Server Applications Daniel L. Silver, Ph.D.
Chapter 1: Introduction to Web
Chapter 33 CGI Technology for Dynamic Web Documents There are two alternative forms of retrieving web documents. Instead of retrieving static HTML documents,
CP476 Internet Computing Lecture 5 : HTTP, WWW and URL 1 Lecture 5. WWW, HTTP and URL Objective: to review the concepts of WWW to understand how HTTP works.
Chapter 17 - Deploying Java Applications on the Web1 Chapter 17 Deploying Java Applications on the Web.
HTML. Principle of Programming  Interface with PC 2 English Japanese Chinese Machine Code Compiler / Interpreter C++ Perl Assembler Machine Code.
20-753: Fundamentals of Web Programming Copyright © 1999, Carnegie Mellon. All Rights Reserved. 1 Lecture 7: HTTP and CGI Fundamentals of Web Programming.
10/13/2015 ©2006 Scott Miller, University of Victoria 1 Content Serving Static vs. Dynamic Content Web Servers Server Flow Control Rev. 2.0.
Chapter 6 Server-side Programming: Java Servlets
1 Welcome to CSC 301 Web Programming Charles Frank.
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
Web Programming Brian Toone 8/27/2014. Outline for today 1.Understanding the architecture of the web 2.Overview of programming languages – Client-side.
Form Data Encoding GET – URL encoded POST – URL encoded
WWW: an Internet application Bill Chu. © Bei-Tseng Chu Aug 2000 WWW Web and HTTP WWW web is an interconnected information servers each server maintains.
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 WWW. 2 World Wide Web Major application protocol used on the Internet Simple interface Two concepts –Point –Click.
Copyright © 2002 ProsoftTraining. All rights reserved. Java Servlets.
Operating Systems Lesson 12. HTTP vs HTML HTML: hypertext markup language ◦ Definitions of tags that are added to Web documents to control their appearance.
IS-907 Java EE World Wide Web - Overview. World Wide Web - History Tim Berners-Lee, CERN, 1990 Enable researchers to share information: Remote Access.
Web Design and Development. World Wide Web  World Wide Web (WWW or W3), collection of globally distributed text and multimedia documents and files 
Scripting Languages Client Side and Server Side. Examples of client side/server side Examples of client-side side include: JavaScript Jquery (uses a JavaScript.
27.1 Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Internet Applications (Cont’d) Basic Internet Applications – World Wide Web (WWW) Browser Architecture Static Documents Dynamic Documents Active Documents.
 Web pages originally static  Page is delivered exactly as stored on server  Same information displayed for all users, from all contexts  Dynamic.
Introduction to CGI PROG. CGI stands for Common Gateway Interface. CGI is a standard programming interface to Web servers that gives us a way to make.
Session 11: Cookies, Sessions ans Security iNET Academy Open Source Web Development.
National College of Science & Information Technology.
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.
Web Development. Agenda Web History Network Architecture Types of Server The languages of the web Protocols API 2.
CS122B: Projects in Databases and Web Applications Spring 2017
CS299: Web Programming and Design Instructor: Dr. Fang (Daisy) Tang
Web Programming Language
Distributed Control and Measurement via the Internet
Web Protocols and Practice
ITM352 PHP and Dynamic Web Pages: Server Side Processing 1.
DBW – Databases and Web development
Web Concepts Lesson 2 ITBS2203 E-Commerce for IT.
WWW and HTTP King Fahd University of Petroleum & Minerals
World Wide Web policy.
Web Development Web Servers.
Introduction and Principles
4166 Review.
Introduction to Programming the WWW I
PHP / MySQL Introduction
WEB API.
Chapter 27 WWW and HTTP.
Web Page Concept and Design :
The HTTP Protocol COSC 2206 Internet Tools The HTTP Protocol
Environment Variables
Architecture of the web
CS122B: Projects in Databases and Web Applications Winter 2019
Web Servers (IIS and Apache)
Web Application Development Using PHP
Presentation transcript:

Web & Web applications DBW 2017

Outline Web basics Concept and types of Web applications. Web services HTTP servers and browsers Languages Software Concept and types of Web applications. Web services CGI Protocol. Time issues Personalization. Cookies & session persistence Languages involved

Reminder: Why Web-based? User interface is provided by standard Web servers and browsers (no need to develop friendly interfaces) No need to install client software (almost) Communications use standard protocols (HTTP, SMTP, SOAP) and languages (HTML, XML) Several programming languages available

Web application anatomy External Apps USER Application Web browser Web server Back-End Web service Client Front-End DB CLIENT SERVER DB SERVER

Web (HTTP) Servers Computer applications that listens to a TCP port (80 typically), and understands HTTP requests. Information served are text or binary files (resources) stored locally in the server. HTTP servers that implements the appropriate protocol, can run server-side applications according to the request. Example SimpleHTTPserver

Web (HTTP) clients (browsers, …) Applications making requests to server at a given TCP port (typically 80) using HTTP protocol Simple browsers requests for files (using HTTP) in a similar way to FTP. Resources are identified by URL (wget for example) Normal browsers “understand” the contents of the obtained files and combine in graphical output information from one or more servers according to a given language (usually HTML) Most browsers can execute applications (client-side) obtained from the information server (scripts, Active-X, applets, ...)

Languages involved HTML: Contents management language Defines contents and structure of the page, includes the necessary links to all elements Tag formatted language (…<p>Some text</p>…) CSS: Formatting language Defines how the contents is represented in the user browsers P {font-family:Times; font-family: 10pt; display:block; background- color:black} Data interchange formats XML: Most traditionally used by web applications Same structure as HTML, but with no fixed tags Requires XML-schema to specify tags and check coherence <Course id=“DBW”> <Acronym>DBW</Acronym> <Title>Databases and Web applications</Title> </Course> JSON: Data interchange format replacing XML Natively understood by Javascript, and of increasing popularity Course: {Acronym: ‘DBW’, Title: ‘Databases and Web applications’}

Software to build Web pages A simple text editor is enough (Notepad, vi, ...) Syntax checking editors are more useful (nedit, NetBeans, ...) WYSWYG editors are common (Dreamweaver, Openoffice...). However, they MUST allow to check HTML manually! Content Manager Systems (CMSs) Integrated environments to build web sites, general or specialized Can include some useful functionality (user management, email, …) Very useful to build static sites, but difficult to include applications However, web structure and layout made by the CMS can be used Drupal, Joomla, Wordpress, Bookstrap, …

Web application anatomy External Apps USER Application Web browser Web server Back-End Web service Client Front-End DB CLIENT SERVER DB SERVER

Definition & types A Web application is a dynamic extension of a Web server. Adapts to user input Can serve non-static information (generated in real-time) Uses standard protocols (HTTP, SMTP) Users can interact with the application using Web browsers Presentation-oriented Generates dynamic Web pages (HTML/HTTP) responding to user queries Usual way to provide bioinformatics results Service-oriented Interacts with other applications (XML/SOAP) Allows to build automatic workflows

Client side Application must be compatible with standard web browsers HTTP protocol: GET, POST Input comes from URL’s or HTML forms Output must be standard HTML (XML, JSON), CSS, Javascript Output may invoke other programs (plug-ins) though MIME Almost obsolete, except Flash HTML v5 include a variety of native functionalities Audio/video, SVG graphics, MathML, Geolocalization, parallel process, … Modern browsers are able to run Java applets, and Javascript Java applets/Javascript are fully qualified applications, served as static files, and run in the browser Javascript is behind most dynamic behaviour of modern web sites (responsiveness). Asynchronous interaction with server (new request do not require reload) JsMol, Jquery, Angular.js,…

Server side Application is invoked by web server External application (CGI) Executable running in the server machine. Can be written in any language. Get input from standard input and writes in the standard output. Web server redirects both. Server embedded (Servlet). Web server is able to execute the application as a child process Special languages: Scripting: PHP, Python, ASP, JSP, .NET, Servlets (Java, Javascript) Java applications require special servers

Standalone CGI application USER Std Input Std Output Standalone CGI application Web browser Web server HTTP/ HTML Local or remote links Servlet DB CLIENT SERVER DB SERVER

CGI Protocol Common Gateway Interface (CGI) External applications Formal interface between Web server and external applications CGI interface provides Environment variables including all relevant information from the browser-server conversation Includes GET queries POST input data, as standard input Redirection of application standard output & error to Web stream. External applications Read Input information from Environment variables, and standard input Provides results and error as standard output Are executed by the operative system as usual command lines executables For security reasons they must be in a special directory (cgi-bin) unless the server in configured otherwise (MIME type cgi). Servlets Are executed as web server’s subprocesses Still use input and output standard and CGI variables, but data is processed

Some CGI variables SERVER_SOFTWARE SERVER_NAME GATEWAY_INTERFACE SERVER_PROTOCOL SERVER_PORT REQUEST_METHOD ("GET", "HEAD", "POST“) PATH_INFO PATH_TRANSLATED SCRIPT_NAME QUERY_STRING REMOTE_HOST REMOTE_ADDR CONTENT_TYPE CONTENT_LENGTH (with POST) HTTP_ACCEPT HTTP_USER_AGENT HTTP_ HTTP headers

Basic Input and Output Input from HTTP “GET” appears as QUERY_STRING Input from POST appears on standard input Output is a document with a MIME Type header Content-type: text/html <blank> <html><body> … </body></html> Or a redirection Location: new URL

The simplest application INPUT interface HTML Forms Data validation Error handling Existing software can remain unaltered OUTPUT Filter Output to HTML. EMail

Servlet languages Depends on the server software used Most popular: Java application servers (Tomcat, Jboss, …): JSP, Java Microsoft servers: ASP (old), Aspx, .NET Standard servers (Apache): PHP, node.js With the appropriate extensions: Perl, Python Most popular: PHP/Apache, Java/Tomcat Growing popularity Python, Javascript (Node.js)

Known issues Time issues Persistence, and User recognition Web users require “instant” responses Most web browsers have short “timeouts” Application that last more that 1-2 mins must be asynchronous Persistence, and User recognition HTTP protocol is not persistent: Connection closes short time after the servers answers Application need to recognize returning users Authentication (user only must write the login/password once) Keep personal preferences, and private data Grant access to given resources according to previous requests Avoid to request known data more than once Avoid “reloads”

Time issues. Usual strategies Data Data ok Input validation Execution queue Output Data End script Confirmation Output Asynchronous Synchronous Email to User

Time issues. Usual strategies Data “polling” Data ok Input validation Execution No Wait until end Finish? Output Data Yes

Standalone application Personalization USER Standalone application ?? Web browser Web server User/Session DB CLIENT SERVER A DB stores history of user connections and activities

Authentication schemes Server based Based on unix-like passwd files (login / passwd) Protects folders and sub-folders (.htaccess files) Identity via CGI variable (REMOTE_USER) May require access to server configuration Persistence via HTTP Environment managed by local DB Application based Do not require access to server configuration Authentication and environment managed by a local DB Full control from the application (login / passwd, SSL Keys, …) Persistence via Cookies or language specific constructs (PHPSessionID / Session) Third party authentication Authentication is done by public servers (Google, openID, ….), or other apps (eGroupWare, Drupal, …) / Session, LDAP

User identification: cookies Small amount of text information stored by the server in the users’ web browser. Do not require user/password (user do not need to be aware of) Limited to 4Kb Cookies can last for a single session or till a specified date Cookies can be used to avoid password request Cookies do not identify persons but browsers!!

Cookies: details Cookies are key / value pairs The normal identification cookie is a unique ID generated by the server Origin: server URL. Browsers send back cookies to the servers that created them (no other servers can get the data) Expiration date

Web application layout hints Static contents (text, images, etc. ) stored as normal web resources Dynamic pages managed by servlet scripts No general rule, depends on language, and programming style The easy way: Each different screen is managed by a specific script. Global variables Each script acts in a separated HTTP transaction! All scripts should load the same global environment, usually included from a single file Protected/public data Protected data should be stored outside of the web directory tree, and be accessed only programmatically

Web application layout hints Temporary data Can be stored anywhere Most language provide automatic temporary directories and file names. Should be deleted after use!! Beware of multiple concurrent users Use request specific file names for temporary data and results Use user based directories Think in a queueing system for lengthy operations Collect statistics of use