Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
MSCS 237 • Overview of web technologies (A specific type of distributed systems) 1 OVERVIEW OF WEB SERVER TECHNOLOGY • The World Wide Web (WWW) builds on existing computers, networks, and services to provide universal access to information through the use of Web browsers. 2 WWW TECHNOLOGIES The WWW builds on three important technologies: • Universal Resource Locators (URLs). • Hypertext Transfer Protocol (HTTP). • Hypertext Markup Language (HTML). 3 UNIVERSAL RESOURCE LOCATOR • URLs provide an address system for locating information anywhere on the Internet. • The following URL points to a file at the domain yahoo.com. It specifies a web page that should be retrieved using the HTTP protocol. http://www.yahoo.com/index.html 4 HYPERTEXT TRANSFER PROTOCOL HTTP provides the communication framework between clients and servers on the Web. • Defines a simple request/response conversation between the client and the server using methods. • The GET method is used to retrieve information (e.g., a Web page). • The POST method is used to store information on a server (e.g., input to a script). 5 HYPERTEXT MARKUP LANGUAGE • HTML is used to create the multimedia hypertext documents that are displayed on Web browsers. • HTML defines the structure and layout of a Web document by using a variety of tags and attributes. • The following example shows the correct structure of a simple html page. <html> <head> (What the document is about) </head> <body> (All the information of the current document) </body> </html> 6 STATIC VERSUS DYNAMIC WEB PAGES Information displayed on a Web browser can either be retrieved from: • Static files that are retrieved and displayed in a browser, or • Dynamically generated files where the contents of a page displayed on a browser can vary due to the execution of software components. 7 DYNAMIC WEB PAGES Dynamically generated pages are especially useful for electronic commerce and other Web applications that use information from a database as a backend to drive the information displayed on a Web page. Examples: • amazon.com • ebay.com • Numerous real-time airline flight tracking systems. 8 METHODS FOR DYNAMIC WEB PAGE GENERATION • • • • • Common Gateway Interface (CGI) Java Applets Java Servlets Active Server Pages (ASP) Server-side JavaScript • Java Server Pages (JSP) 9 COMMON GATEWAY INTERFACE (CGI) • CGI scripts were one of the first methods for dynamic Web page generation. • A Web server passes requests to an external program. The output of the external program is returned as a static file. • Typically used with the Perl programming language. • Inefficient since it creates a separate process for each request. • CGI scripts pose security concerns since they execute as regular programs on the Web server system. 10 CGI - BASED WEB SERVER (Diagram from Web Server Technology, Morgan Kaufmann, N. Yeager and R. McGrath, 1996) 11 JAVA APPLETS • Applets are Java programs that are embedded directly into HTML pages. An application designed to be executed from within another application. • Applet byte code is downloaded to the client and executed by the browser when a browser downloads a page with a reference to an applet. • Download time can be unacceptable for large applets. • The applet will not run if the client is not using a compatible browser. 12 JAVA SERVLETS • A Java servlet is a Java class that can be loaded dynamically to expand the functionality of a server. • The Java servlet generates full HTML pages to be displayed on a Web browser. • Executes in the Java Virtual Machine (JVM) on the server (thus solving the security problem associated with CGI). 13 JAVA SERVLETS vs. CGI & APPLETS • Executes on the server (thus solving browser compatibility problems associated with applets). • More efficient than CGI since servlets do not create separate processes for each request. • Portable across operating systems and Web servers. 14 JAVA SERVLET-BASED WEB SERVER (Diagram from Web Server Technology, Morgan Kaufmann, N. Yeager and R. McGrath, 1996) 15 JAVA SERVLETS EXAMPLE • Java servlets can also be used as server-side includes where the servlet is embedded inside of HTML. • The JDBC example is a servlet based application that provides the capability to connect to any relational database registered as an ODBC data source. 16 ACTIVE SERVER PAGES (ASP) • An HTML page that contains embedded code, such as VBScript or JScript. • Separates the user interface from the underlying content generation. • The embedded code is executed by the Web server before the page is sent to the browser. 17 SERVER-SIDE JAVASCRIPT • A server-side scripting language from Netscape that is embedded in HTML pages. • Web pages are pre-compiled on the server-side to improve performance. • Limited Support. 18 JAVA SERVER PAGES (JSP) • Extension of the Java Servlet API. • Uses Java as a scripting language. • Separates the user interface from the underlying content generation. • Platform and server independent. • Usually used in combination with Java Beans, which are Java objects with set and get methods. 19 References • http://www.extremetech.com/article2/0,397 3,1154106,00.asp • http://java.sun.com/features/1997/nov/rmi. html • http://java.sun.com/developer/onlineTraini ng/Programming/JDCBook/dist.html • http://www.meteoam.it/egows/Atti/Zuerche r_proceeding.pdf 20