SlideShare une entreprise Scribd logo
1  sur  67
Télécharger pour lire hors ligne
HTTP, JSP, and AJAX

          Ang Chen

    CUI, University of Geneva


  PINFO 05-06 May 8, 2006
Outline
  Introduction
      Overview
      WEB 1.0 vs WEB 2.0
  HTTP, CGI, Web Application Model
    HTTP
    Common Gateway Interface (CGI)
    Web Application Model
    Summary
  Servlet & JSP
     Servlet
     Java Server Pages
  AJAX
    Using AJAX
  Summary
  Resources
Outline
  Introduction
      Overview
      WEB 1.0 vs WEB 2.0
  HTTP, CGI, Web Application Model
    HTTP
    Common Gateway Interface (CGI)
    Web Application Model
    Summary
  Servlet & JSP
     Servlet
     Java Server Pages
  AJAX
     Using AJAX
  Summary
  Resources
Overview

  This presentation provides a brief introduction of:
      HTTP, CGI, Web Application Model
      Servlets & JSP
      AJAX
  What it does not include (many!) but can be found in references:
      Complete technical details, APIs: e.g Taglib, JavaScript,
      HTML, DOM
      How to configure Tomcat and deploy applications
      How to manage sessions with cookies and URL rewriting.
      How to use JavaBeans in JSP
      Development Frameworks with JSP and AJAX, e.g. Struts,
      various AJAX frameworks.
WEB 1.0 vs WEB 2.0


  Technically, they are the same. ”Old wine in a new bottle.”
  But, the Use Cases are different.
  WEB 1.0:
      User browses the content on the server(the Web), the
      server(the Web) return the desired content.
      The Internet Content Provider(ICP) provides the contents to
      clients.
  WEB 2.0:
      User reads and write content from/to the Web.
      Most contents are provided by Internet users. The Web as
      Platform.
WEB 2.0


  Example of WEB 2.0:
      WebBlog, Social Networks, Contents Sharing, Wiki, RSS
      (Really Simple Syndication), PodCast
      Google Maps, Gmail, AdSense, Writely, Flickr, del.icio.us,
      eBay, Amazon, BitTorrent
  Keywords of WEB 2.0:
      Sharing, Tagging, Syndication, Blogging,
      Services, Simplicity, Re-usability
  Note that sometimes the term WEB 2.0 is more marketing than its
  real sense.
Outline
  Introduction
      Overview
      WEB 1.0 vs WEB 2.0
  HTTP, CGI, Web Application Model
    HTTP
    Common Gateway Interface (CGI)
    Web Application Model
    Summary
  Servlet & JSP
     Servlet
     Java Server Pages
  AJAX
     Using AJAX
  Summary
  Resources
HTTP: Hypertext Transfer Protocol I



     A generic protocol for data transfer across the Internet, RFC
     2616.
     HTTP Extensions and HTTP 1.1 are stable specifications and
     W3C has closed the HTTP Activity.
     Client/Server architecture: the client sends a request, the
     server responses. The protocol consists of several parts:
     communication, access authentication, message format,
     encoding, caching, etc.
HTTP: Hypertext Transfer Protocol I



     A generic protocol for data transfer across the Internet, RFC
     2616.
     HTTP Extensions and HTTP 1.1 are stable specifications and
     W3C has closed the HTTP Activity.
     Client/Server architecture: the client sends a request, the
     server responses. The protocol consists of several parts:
     communication, access authentication, message format,
     encoding, caching, etc.
HTTP: Hypertext Transfer Protocol I



     A generic protocol for data transfer across the Internet, RFC
     2616.
     HTTP Extensions and HTTP 1.1 are stable specifications and
     W3C has closed the HTTP Activity.
     Client/Server architecture: the client sends a request, the
     server responses. The protocol consists of several parts:
     communication, access authentication, message format,
     encoding, caching, etc.
HTTP: Hypertext Transfer Protocol II


  To write Web applications, we are interested in the most used
  communication primitives between the client(browser) and the
  Web server:
      GET: retrieve the information identified by the Request-URI.
      POST: providing a block of data to server, e.g. posting a
      message, filling a form, etc.
      PUT: request to store the enclosed entity under the
      Request-URI, e.g. uploading a file.
      DELETE: request to delete the resource identified by the
      Request-URI, e.g. deleting an uploaded file.
HTTP: Hypertext Transfer Protocol II


  To write Web applications, we are interested in the most used
  communication primitives between the client(browser) and the
  Web server:
      GET: retrieve the information identified by the Request-URI.
      POST: providing a block of data to server, e.g. posting a
      message, filling a form, etc.
      PUT: request to store the enclosed entity under the
      Request-URI, e.g. uploading a file.
      DELETE: request to delete the resource identified by the
      Request-URI, e.g. deleting an uploaded file.
HTTP: Hypertext Transfer Protocol II


  To write Web applications, we are interested in the most used
  communication primitives between the client(browser) and the
  Web server:
      GET: retrieve the information identified by the Request-URI.
      POST: providing a block of data to server, e.g. posting a
      message, filling a form, etc.
      PUT: request to store the enclosed entity under the
      Request-URI, e.g. uploading a file.
      DELETE: request to delete the resource identified by the
      Request-URI, e.g. deleting an uploaded file.
HTTP: Hypertext Transfer Protocol II


  To write Web applications, we are interested in the most used
  communication primitives between the client(browser) and the
  Web server:
      GET: retrieve the information identified by the Request-URI.
      POST: providing a block of data to server, e.g. posting a
      message, filling a form, etc.
      PUT: request to store the enclosed entity under the
      Request-URI, e.g. uploading a file.
      DELETE: request to delete the resource identified by the
      Request-URI, e.g. deleting an uploaded file.
Common Gateway Interface (CGI) I




  CGI is a standard for interfacing external applications with
  information servers, such as HTTP or Web servers.
  Very important evolution: Static pages -> dynamic pages
  CGI programs can be written by using any programming languages
  with input/output, e.g. C, C++, Perl, Shell, Fortran, TCL ...
Common Gateway Interface (CGI) II



  But CGI has the following problems:
      Performance: each CGI program instance is a process of
      operation system, i.e. for each request from client, the OS
      create a process.
      Security: a Web application, as it is a normal application, can
      block or crash the server.
      Manageability: difficult to manage the set of CGI programs
      and connect them together.
Common Gateway Interface (CGI) II



  But CGI has the following problems:
      Performance: each CGI program instance is a process of
      operation system, i.e. for each request from client, the OS
      create a process.
      Security: a Web application, as it is a normal application, can
      block or crash the server.
      Manageability: difficult to manage the set of CGI programs
      and connect them together.
Common Gateway Interface (CGI) II



  But CGI has the following problems:
      Performance: each CGI program instance is a process of
      operation system, i.e. for each request from client, the OS
      create a process.
      Security: a Web application, as it is a normal application, can
      block or crash the server.
      Manageability: difficult to manage the set of CGI programs
      and connect them together.
Web Application Model


  Web Application Models are proposed for the separation of
  responsibilities between the Web server and Web application, and
  how to collaborate to get better performance.
      Easy to be managed, Web applications are homogeneous and
      securer.
      More efficient, e.g using thread pool to manage the
      application instances.
      Use the Inverse of Control principle.
      Examples: Apache modules (for php, perl etc.), Web
      application container (e.g. Tomcat).
      With the same approach: Application Server (AS), e.g.
      Enterprise JavaBean container.
Summary




    HTTP for : client / server communication
    CGI for : Web server / Application Integration
    JSP / Servlet : a model used for creating Java Web
    applications. Using the container model.
    We proceed with JSP/Servlet.
Summary




    HTTP for : client / server communication
    CGI for : Web server / Application Integration
    JSP / Servlet : a model used for creating Java Web
    applications. Using the container model.
    We proceed with JSP/Servlet.
Summary




    HTTP for : client / server communication
    CGI for : Web server / Application Integration
    JSP / Servlet : a model used for creating Java Web
    applications. Using the container model.
    We proceed with JSP/Servlet.
Summary




    HTTP for : client / server communication
    CGI for : Web server / Application Integration
    JSP / Servlet : a model used for creating Java Web
    applications. Using the container model.
    We proceed with JSP/Servlet.
Outline
  Introduction
      Overview
      WEB 1.0 vs WEB 2.0
  HTTP, CGI, Web Application Model
    HTTP
    Common Gateway Interface (CGI)
    Web Application Model
    Summary
  Servlet & JSP
     Servlet
     Java Server Pages
  AJAX
     Using AJAX
  Summary
  Resources
Java Web Application Model
                           Web Server
           Web Application Container

                                                          request/response
      Web Application      Web Application
          /app1                /app2
          servlet              servlet         request
                                               handling
          servlet              servlet
                                                                client
          servlet              servlet




             Server side Service Invocation




        Server Side Apps           Database



                    Figure: Java Web Application Model
Java Web Application Model


  There are several levels of scope, where each one has its
  parameters:
      Container: system-wide configuration
      Application: application configuration and parameters
      Servlet: servlet information and parameters
      Page: information related with a JSP
      Session: session information can cross pages and servlets,
      session can be used to store objects
  Each level is modeled by a Java class or interface. (Implicit objects
  in JSP)
Interface javax.servlet.Servlet


   This interface defines methods to initialize a servlet, to service
   requests, and to remove a servlet from the server:
       The servlet is constructed, then initialized with the init
       method.
       Any calls from clients to the service method are handled.
       The servlet is taken out of service, then destroyed with the
       destroy method, then garbage collected and finalized.
   In addition to the life-cycle methods, this interface provides the
   getServletConfig method, which the servlet can use to get any
   startup information, and the getServletInfo method, which allows
   the servlet to return basic information about itself, such as author,
   version, and copyright.
Abstract Class javax.servlet.GenericServlet



   The abstract class GenericServlet defines a generic,
   protocol-independent servlet.
       It implements the Servlet and ServletConfig interface.
       It provides simple versions of the lifecycle methods init and
       destroy and of the methods in the ServletConfig interface.
       GenericServlet also implements the log method, declared in
       the ServletContext interface.
   To write a generic servlet, you need only override the abstract
   service method. HttpServlet is a subclass of GenericServlet using
   HTTP protocol.
Abstract class javax.servlet.http.HttpServlet

   The abstract class HttpServlet is designed to be subclassed to
   create an HTTP servlet suitable for a Web site. A subclass of
   HttpServlet must override at least one method, usually one of
   these:
       doGet, if the servlet supports HTTP GET requests
       doPost, for HTTP POST requests
       doPut, for HTTP PUT requests
       doDelete, for HTTP DELETE requests
       init and destroy, to manage resources that are held for the life
       of the servlet
       getServletInfo, which the servlet uses to provide information
       about itself
Abstract class javax.servlet.http.HttpServlet

   The abstract class HttpServlet is designed to be subclassed to
   create an HTTP servlet suitable for a Web site. A subclass of
   HttpServlet must override at least one method, usually one of
   these:
       doGet, if the servlet supports HTTP GET requests
       doPost, for HTTP POST requests
       doPut, for HTTP PUT requests
       doDelete, for HTTP DELETE requests
       init and destroy, to manage resources that are held for the life
       of the servlet
       getServletInfo, which the servlet uses to provide information
       about itself
Abstract class javax.servlet.http.HttpServlet

   The abstract class HttpServlet is designed to be subclassed to
   create an HTTP servlet suitable for a Web site. A subclass of
   HttpServlet must override at least one method, usually one of
   these:
       doGet, if the servlet supports HTTP GET requests
       doPost, for HTTP POST requests
       doPut, for HTTP PUT requests
       doDelete, for HTTP DELETE requests
       init and destroy, to manage resources that are held for the life
       of the servlet
       getServletInfo, which the servlet uses to provide information
       about itself
Abstract class javax.servlet.http.HttpServlet

   The abstract class HttpServlet is designed to be subclassed to
   create an HTTP servlet suitable for a Web site. A subclass of
   HttpServlet must override at least one method, usually one of
   these:
       doGet, if the servlet supports HTTP GET requests
       doPost, for HTTP POST requests
       doPut, for HTTP PUT requests
       doDelete, for HTTP DELETE requests
       init and destroy, to manage resources that are held for the life
       of the servlet
       getServletInfo, which the servlet uses to provide information
       about itself
Abstract class javax.servlet.http.HttpServlet

   The abstract class HttpServlet is designed to be subclassed to
   create an HTTP servlet suitable for a Web site. A subclass of
   HttpServlet must override at least one method, usually one of
   these:
       doGet, if the servlet supports HTTP GET requests
       doPost, for HTTP POST requests
       doPut, for HTTP PUT requests
       doDelete, for HTTP DELETE requests
       init and destroy, to manage resources that are held for the life
       of the servlet
       getServletInfo, which the servlet uses to provide information
       about itself
Abstract class javax.servlet.http.HttpServlet

   The abstract class HttpServlet is designed to be subclassed to
   create an HTTP servlet suitable for a Web site. A subclass of
   HttpServlet must override at least one method, usually one of
   these:
       doGet, if the servlet supports HTTP GET requests
       doPost, for HTTP POST requests
       doPut, for HTTP PUT requests
       doDelete, for HTTP DELETE requests
       init and destroy, to manage resources that are held for the life
       of the servlet
       getServletInfo, which the servlet uses to provide information
       about itself
Writing a HttpServlet

  A Servlet which returns ”Hello World” to the browser

  import java.io.*;
  import javax.servlet.*;
  import javax.servlet.http.*;

  public class HelloWorld extends HttpServlet {
    public void doGet(HttpServletRequest request,
                      HttpServletResponse response)
        throws ServletException, IOException {
      PrintWriter out = response.getWriter();
      out.println(quot;Hello Worldquot;);
    }
    public String getServletInfo() {
    return quot;Hello world example for PINFOquot;;
    }
  }
Writing a HttpServlet II

   Return HTML content
   import java.io.*;
   import javax.servlet.*;
   import javax.servlet.http.*;

   public class HelloWorld extends HttpServlet {
     public void doGet(HttpServletRequest request,
                       HttpServletResponse response)
         throws ServletException, IOException {
       response.setContentType(quot;text/htmlquot;); // set HTTP response content type
       PrintWriter out = response.getWriter();
       out.println(quot;<!DOCTYPE HTML PUBLIC quot;-//W3C//DTD HTML 4.0 quot; +
                                            quot;Transitional//ENquot;>nquot; +
                   quot;<HTML>nquot; +
                   quot;<HEAD><TITLE>Hello WWW</TITLE></HEAD>nquot; +
                   quot;<BODY>nquot; +
                   quot;<H1>Hello WWW</H1>nquot; +
                   quot;</BODY></HTML>quot;);
     }
     public String getServletInfo() {
     return quot;Hello world example for PINFOquot;;
     }
   }
Get the value of the request parameter


  HttpServletRequest class
  Request URL: http://localhost:8080/list.jsp?category=pinfo05

  public void doGet(HttpServletRequest request,
       HttpServletResponse response) throws ... {
            ...
           String cat = request.getParameter(quot;categoryquot;);
           ...}

  cat will have value ”pinfo05”. It works for both GET and POST requests.

  Two important classes: HttpServletRequest contains information
  about the request; HttpServletResponse is used to generate HTTP
  response.
Java Server Pages


  Java Server Pages
  A way of creating dynamic pages with Java and HTML.
  Principle: Java for application logic, HTML for presentation.
  JSP uses HTML for page rendering, and provides several ways to
  use Java components:
      Scriptlet: Java codes enclosed by <% and %>
      Taglib: customized JSP tags
      Using JavaBeans
  JSP are translated into Java servlets before they are compiled by
  the Web application container. HttpServletRequest and
  HttpServletResponse are implicit objects in JSP.
Implicit Objects in Java Server Page

  The following variables can be directly used in JSP:
      page: jsp.HttpJspPage : Page’s servlet instance
      config: ServletConfig : Servlet configuration information
      pageContext: jsp.pageContext : Provides access to all the
      namespaces associated with a JSP page and access to several
      page attributes
      request: http.HttpServletRequest : Data included with the
      HTTP Request
      response: http.HttpServletResponse : HTTP Response data,
      e.g. cookies
      out: jsp.JspWriter : Output stream for page context
      session: http.HttpSession : User specific session data
      application: ServletContext : Data shared by all application
      pages
Implicit Objects in Java Server Page

  The following variables can be directly used in JSP:
      page: jsp.HttpJspPage : Page’s servlet instance
      config: ServletConfig : Servlet configuration information
      pageContext: jsp.pageContext : Provides access to all the
      namespaces associated with a JSP page and access to several
      page attributes
      request: http.HttpServletRequest : Data included with the
      HTTP Request
      response: http.HttpServletResponse : HTTP Response data,
      e.g. cookies
      out: jsp.JspWriter : Output stream for page context
      session: http.HttpSession : User specific session data
      application: ServletContext : Data shared by all application
      pages
Implicit Objects in Java Server Page

  The following variables can be directly used in JSP:
      page: jsp.HttpJspPage : Page’s servlet instance
      config: ServletConfig : Servlet configuration information
      pageContext: jsp.pageContext : Provides access to all the
      namespaces associated with a JSP page and access to several
      page attributes
      request: http.HttpServletRequest : Data included with the
      HTTP Request
      response: http.HttpServletResponse : HTTP Response data,
      e.g. cookies
      out: jsp.JspWriter : Output stream for page context
      session: http.HttpSession : User specific session data
      application: ServletContext : Data shared by all application
      pages
Implicit Objects in Java Server Page

  The following variables can be directly used in JSP:
      page: jsp.HttpJspPage : Page’s servlet instance
      config: ServletConfig : Servlet configuration information
      pageContext: jsp.pageContext : Provides access to all the
      namespaces associated with a JSP page and access to several
      page attributes
      request: http.HttpServletRequest : Data included with the
      HTTP Request
      response: http.HttpServletResponse : HTTP Response data,
      e.g. cookies
      out: jsp.JspWriter : Output stream for page context
      session: http.HttpSession : User specific session data
      application: ServletContext : Data shared by all application
      pages
Implicit Objects in Java Server Page

  The following variables can be directly used in JSP:
      page: jsp.HttpJspPage : Page’s servlet instance
      config: ServletConfig : Servlet configuration information
      pageContext: jsp.pageContext : Provides access to all the
      namespaces associated with a JSP page and access to several
      page attributes
      request: http.HttpServletRequest : Data included with the
      HTTP Request
      response: http.HttpServletResponse : HTTP Response data,
      e.g. cookies
      out: jsp.JspWriter : Output stream for page context
      session: http.HttpSession : User specific session data
      application: ServletContext : Data shared by all application
      pages
Implicit Objects in Java Server Page

  The following variables can be directly used in JSP:
      page: jsp.HttpJspPage : Page’s servlet instance
      config: ServletConfig : Servlet configuration information
      pageContext: jsp.pageContext : Provides access to all the
      namespaces associated with a JSP page and access to several
      page attributes
      request: http.HttpServletRequest : Data included with the
      HTTP Request
      response: http.HttpServletResponse : HTTP Response data,
      e.g. cookies
      out: jsp.JspWriter : Output stream for page context
      session: http.HttpSession : User specific session data
      application: ServletContext : Data shared by all application
      pages
Implicit Objects in Java Server Page

  The following variables can be directly used in JSP:
      page: jsp.HttpJspPage : Page’s servlet instance
      config: ServletConfig : Servlet configuration information
      pageContext: jsp.pageContext : Provides access to all the
      namespaces associated with a JSP page and access to several
      page attributes
      request: http.HttpServletRequest : Data included with the
      HTTP Request
      response: http.HttpServletResponse : HTTP Response data,
      e.g. cookies
      out: jsp.JspWriter : Output stream for page context
      session: http.HttpSession : User specific session data
      application: ServletContext : Data shared by all application
      pages
Implicit Objects in Java Server Page

  The following variables can be directly used in JSP:
      page: jsp.HttpJspPage : Page’s servlet instance
      config: ServletConfig : Servlet configuration information
      pageContext: jsp.pageContext : Provides access to all the
      namespaces associated with a JSP page and access to several
      page attributes
      request: http.HttpServletRequest : Data included with the
      HTTP Request
      response: http.HttpServletResponse : HTTP Response data,
      e.g. cookies
      out: jsp.JspWriter : Output stream for page context
      session: http.HttpSession : User specific session data
      application: ServletContext : Data shared by all application
      pages
Outline
  Introduction
      Overview
      WEB 1.0 vs WEB 2.0
  HTTP, CGI, Web Application Model
    HTTP
    Common Gateway Interface (CGI)
    Web Application Model
    Summary
  Servlet & JSP
     Servlet
     Java Server Pages
  AJAX
    Using AJAX
  Summary
  Resources
Asynchronous JavaScript And XML (AJAX)



  AJAX incorporates several technologies:
      standards-based presentation using XHTML and CSS;
      dynamic display and interaction using the Document Object
      Model;
      data interchange and manipulation using XML and XSLT;
      asynchronous data retrieval using XMLHttpRequest;
      and JavaScript binding everything together.
  www.w3schools.com provides tutorials for XHTML, CSS, DOM,
  XML, AJAX, JavaScript etc.
Asynchronous JavaScript And XML (AJAX)



  AJAX incorporates several technologies:
      standards-based presentation using XHTML and CSS;
      dynamic display and interaction using the Document Object
      Model;
      data interchange and manipulation using XML and XSLT;
      asynchronous data retrieval using XMLHttpRequest;
      and JavaScript binding everything together.
  www.w3schools.com provides tutorials for XHTML, CSS, DOM,
  XML, AJAX, JavaScript etc.
Asynchronous JavaScript And XML (AJAX)



  AJAX incorporates several technologies:
      standards-based presentation using XHTML and CSS;
      dynamic display and interaction using the Document Object
      Model;
      data interchange and manipulation using XML and XSLT;
      asynchronous data retrieval using XMLHttpRequest;
      and JavaScript binding everything together.
  www.w3schools.com provides tutorials for XHTML, CSS, DOM,
  XML, AJAX, JavaScript etc.
Asynchronous JavaScript And XML (AJAX)



  AJAX incorporates several technologies:
      standards-based presentation using XHTML and CSS;
      dynamic display and interaction using the Document Object
      Model;
      data interchange and manipulation using XML and XSLT;
      asynchronous data retrieval using XMLHttpRequest;
      and JavaScript binding everything together.
  www.w3schools.com provides tutorials for XHTML, CSS, DOM,
  XML, AJAX, JavaScript etc.
Asynchronous JavaScript And XML (AJAX)



  AJAX incorporates several technologies:
      standards-based presentation using XHTML and CSS;
      dynamic display and interaction using the Document Object
      Model;
      data interchange and manipulation using XML and XSLT;
      asynchronous data retrieval using XMLHttpRequest;
      and JavaScript binding everything together.
  www.w3schools.com provides tutorials for XHTML, CSS, DOM,
  XML, AJAX, JavaScript etc.
AJAX: Connect HTML with JavaScript


  Capture Events on HTML pages
      Mouse event (with elements): mouse down, mouse up, mouse
      move, mouse over ...
      Keyboard event: key pressed ...
      Form: submitted ...
      Timer etc.
  Example: Call the getListByCategory function when the mouse is
  moved over the hyper linked text, and call the function cleanTable
  when the moused is moved out the link.
  <a href=quot;/quot; onmouseover=quot;getListByCategory()quot;
  onmouseout=quot;clearTable()quot;>Show Member List</a>
AJAX: Create XMLHttpRequest Object
  This function will create an XMLHttpRequest object and send a GET
  request to the server page http://pinfo.unige.ch:8080/Member/list.jsp
  with parameter category with value pinfo05.
  Send a HTTP request via XMLHttpRequest Object:

    function getListByCategory() {
        var req = false;
        var self = this;

        var url = quot;http://pinfo.unige.ch:8080/Member/list.jsp?category=pinfo05quot;;

        if (window.XMLHttpRequest) {
            self.req = new XMLHttpRequest(); // for Firefox and other browsers
        } else if (window.ActiveXObject) {
            self.req = new ActiveXObject(quot;Microsoft.XMLHTTPquot;); // for IE browser
        }
        // when the request is finished, call this function
        self.req.onreadystatechange = processRequest;
        self.req.open(quot;GETquot;, url, true); // it is a GET request
        self.req.send(null); // send the request
    }



  Note that the implementation of XMLHttpRequest is different from one
  browser to another.
AJAX: Handling Asynchronous Response

  A node is tagged with id ”result” in the HTML document

  <div id=result></div>

  The function processRequest is called when the XMLHttpRequest
  is finished (asynchronous response).

    function processRequest() {
      // check the request state is quot;completequot;
         if (req.readyState == 4 || req.readyState == quot;completequot;) {
             if (req.status == 200) {
               updatepage(self.req.responseText);
             } else {
                  alert(quot;Not able to retrieve member listquot;);
             }
         }
    }
    // Just set the content of note with id quot;resultquot; with the input parameter
    // Other DOM and XML operations are possible, here it is simplified.
    function updatepage(str) {
         document.getElementById(quot;resultquot;).innerHTML = str;
    }
AJAX: Web Application Model




            Figure: AJAX Web Application Model
AJAX: Interactions




                Figure: AJAX Interactions
Outline
  Introduction
      Overview
      WEB 1.0 vs WEB 2.0
  HTTP, CGI, Web Application Model
    HTTP
    Common Gateway Interface (CGI)
    Web Application Model
    Summary
  Servlet & JSP
     Servlet
     Java Server Pages
  AJAX
     Using AJAX
  Summary
  Resources
Summary


    Web Application Model: relations between client, Web server,
    server side application, and web application. The Application
    Container model is mature.
    JSP and Servlets provide server side programming facilities:
    reusability, manageability, security etc.
    AJAX provides a standard solution for client/server
    interaction: XML based, Asynchronous, no page refresh
    needed. It is the most used technology in WEB 2.0.
    AJAX is the complement for the presentation layer of Web
    applications with JSP: JSP provides services, AJAX use these
    services, messages are in XML, communication via HTTP.
    WEB 2.0 is more than AJAX.
Summary


    Web Application Model: relations between client, Web server,
    server side application, and web application. The Application
    Container model is mature.
    JSP and Servlets provide server side programming facilities:
    reusability, manageability, security etc.
    AJAX provides a standard solution for client/server
    interaction: XML based, Asynchronous, no page refresh
    needed. It is the most used technology in WEB 2.0.
    AJAX is the complement for the presentation layer of Web
    applications with JSP: JSP provides services, AJAX use these
    services, messages are in XML, communication via HTTP.
    WEB 2.0 is more than AJAX.
Summary


    Web Application Model: relations between client, Web server,
    server side application, and web application. The Application
    Container model is mature.
    JSP and Servlets provide server side programming facilities:
    reusability, manageability, security etc.
    AJAX provides a standard solution for client/server
    interaction: XML based, Asynchronous, no page refresh
    needed. It is the most used technology in WEB 2.0.
    AJAX is the complement for the presentation layer of Web
    applications with JSP: JSP provides services, AJAX use these
    services, messages are in XML, communication via HTTP.
    WEB 2.0 is more than AJAX.
Summary


    Web Application Model: relations between client, Web server,
    server side application, and web application. The Application
    Container model is mature.
    JSP and Servlets provide server side programming facilities:
    reusability, manageability, security etc.
    AJAX provides a standard solution for client/server
    interaction: XML based, Asynchronous, no page refresh
    needed. It is the most used technology in WEB 2.0.
    AJAX is the complement for the presentation layer of Web
    applications with JSP: JSP provides services, AJAX use these
    services, messages are in XML, communication via HTTP.
    WEB 2.0 is more than AJAX.
Summary


    Web Application Model: relations between client, Web server,
    server side application, and web application. The Application
    Container model is mature.
    JSP and Servlets provide server side programming facilities:
    reusability, manageability, security etc.
    AJAX provides a standard solution for client/server
    interaction: XML based, Asynchronous, no page refresh
    needed. It is the most used technology in WEB 2.0.
    AJAX is the complement for the presentation layer of Web
    applications with JSP: JSP provides services, AJAX use these
    services, messages are in XML, communication via HTTP.
    WEB 2.0 is more than AJAX.
Summary


    Web Application Model: relations between client, Web server,
    server side application, and web application. The Application
    Container model is mature.
    JSP and Servlets provide server side programming facilities:
    reusability, manageability, security etc.
    AJAX provides a standard solution for client/server
    interaction: XML based, Asynchronous, no page refresh
    needed. It is the most used technology in WEB 2.0.
    AJAX is the complement for the presentation layer of Web
    applications with JSP: JSP provides services, AJAX use these
    services, messages are in XML, communication via HTTP.
    WEB 2.0 is more than AJAX.
Outline
  Introduction
      Overview
      WEB 1.0 vs WEB 2.0
  HTTP, CGI, Web Application Model
    HTTP
    Common Gateway Interface (CGI)
    Web Application Model
    Summary
  Servlet & JSP
     Servlet
     Java Server Pages
  AJAX
     Using AJAX
  Summary
  Resources
Servlet, JSP



  Specifications:
       Java Servlet Specifications
       JSP Technology
  Tutorial:
       Basic Servlets:
       http://www.apl.jhu.edu/ hall/java/Servlet-Tutorial/
       MoreServlets Book & Tutorials: Servlet, JSP, Taglib, Struts,
       AJAX
AJAX, WEB 2.0

  AJAX:
     Ajax: A New Approach to Web Applications
     AJAX: Getting Started, mozilla developer center
     Top 10 Ajax Applications
     AJAX Tutorial
     AJAX Login System Demo
     Guide to Using AJAX and XMLHttpRequest
     Ajaxian
  WEB 2.0
     O’Reilly: What Is Web 2.0
     The Best Web 2.0 Software of 2005
     Writly
     Google Earth

Contenu connexe

Tendances (20)

Jsp
JspJsp
Jsp
 
Asp.net.
Asp.net.Asp.net.
Asp.net.
 
Java Server Pages
Java Server PagesJava Server Pages
Java Server Pages
 
JSP - Java Server Page
JSP - Java Server PageJSP - Java Server Page
JSP - Java Server Page
 
Jsp sasidhar
Jsp sasidharJsp sasidhar
Jsp sasidhar
 
JAVA SERVER PAGES
JAVA SERVER PAGESJAVA SERVER PAGES
JAVA SERVER PAGES
 
Ajax
AjaxAjax
Ajax
 
Implicit objects advance Java
Implicit objects advance JavaImplicit objects advance Java
Implicit objects advance Java
 
Java Server Pages
Java Server PagesJava Server Pages
Java Server Pages
 
JSP Scope variable And Data Sharing
JSP Scope variable And Data SharingJSP Scope variable And Data Sharing
JSP Scope variable And Data Sharing
 
Implicit object.pptx
Implicit object.pptxImplicit object.pptx
Implicit object.pptx
 
JSP- JAVA SERVER PAGES
JSP- JAVA SERVER PAGESJSP- JAVA SERVER PAGES
JSP- JAVA SERVER PAGES
 
Introduction to ajax
Introduction to ajaxIntroduction to ajax
Introduction to ajax
 
Ajax
AjaxAjax
Ajax
 
Jsp (java server page)
Jsp (java server page)Jsp (java server page)
Jsp (java server page)
 
AJAX
AJAXAJAX
AJAX
 
Java Servlet
Java ServletJava Servlet
Java Servlet
 
Unit 4 web technology uptu
Unit 4 web technology uptuUnit 4 web technology uptu
Unit 4 web technology uptu
 
Jquery Ajax
Jquery AjaxJquery Ajax
Jquery Ajax
 
Jsp slides
Jsp slidesJsp slides
Jsp slides
 

Similaire à Jsp & Ajax

Similaire à Jsp & Ajax (20)

Servlet by Rj
Servlet by RjServlet by Rj
Servlet by Rj
 
Ecom 1
Ecom 1Ecom 1
Ecom 1
 
Intorduction to struts
Intorduction to strutsIntorduction to struts
Intorduction to struts
 
Server side programming
Server side programming Server side programming
Server side programming
 
Ajp notes-chapter-06
Ajp notes-chapter-06Ajp notes-chapter-06
Ajp notes-chapter-06
 
Servlet classnotes
Servlet classnotesServlet classnotes
Servlet classnotes
 
Asif
AsifAsif
Asif
 
Web Services 2009
Web Services 2009Web Services 2009
Web Services 2009
 
Web Services 2009
Web Services 2009Web Services 2009
Web Services 2009
 
Web technology
Web technologyWeb technology
Web technology
 
Marata
MarataMarata
Marata
 
Ws
WsWs
Ws
 
Anintroductiontojavawebtechnology 090324184240-phpapp01
Anintroductiontojavawebtechnology 090324184240-phpapp01Anintroductiontojavawebtechnology 090324184240-phpapp01
Anintroductiontojavawebtechnology 090324184240-phpapp01
 
Servlet in java , java servlet , servlet servlet and CGI, API
Servlet in java , java servlet , servlet servlet and CGI, APIServlet in java , java servlet , servlet servlet and CGI, API
Servlet in java , java servlet , servlet servlet and CGI, API
 
Programming Server side with Sevlet
 Programming Server side with Sevlet  Programming Server side with Sevlet
Programming Server side with Sevlet
 
An implementation of embedded RESTful Web services.pdf
An implementation of embedded RESTful Web services.pdfAn implementation of embedded RESTful Web services.pdf
An implementation of embedded RESTful Web services.pdf
 
Unit 02: Web Technologies (2/2)
Unit 02: Web Technologies (2/2)Unit 02: Web Technologies (2/2)
Unit 02: Web Technologies (2/2)
 
Application server vs Web Server
Application server vs Web ServerApplication server vs Web Server
Application server vs Web Server
 
Servlets
ServletsServlets
Servlets
 
Servlets api overview
Servlets api overviewServlets api overview
Servlets api overview
 

Plus de Ang Chen

Defence: A multi-dimensional compositional approach for business process (sem...
Defence: A multi-dimensional compositional approach for business process (sem...Defence: A multi-dimensional compositional approach for business process (sem...
Defence: A multi-dimensional compositional approach for business process (sem...Ang Chen
 
A Multi-Dimensional Compositional Approach for Business Process Engineering
A Multi-Dimensional Compositional Approach for Business Process EngineeringA Multi-Dimensional Compositional Approach for Business Process Engineering
A Multi-Dimensional Compositional Approach for Business Process EngineeringAng Chen
 
A Proposition for Business Process Modeling
A Proposition for Business Process ModelingA Proposition for Business Process Modeling
A Proposition for Business Process ModelingAng Chen
 
Synchronized Composition Of Labeled Transition SystemTS
Synchronized Composition Of Labeled Transition SystemTSSynchronized Composition Of Labeled Transition SystemTS
Synchronized Composition Of Labeled Transition SystemTSAng Chen
 
Semantics (requirements) of Business Process
Semantics (requirements) of Business ProcessSemantics (requirements) of Business Process
Semantics (requirements) of Business ProcessAng Chen
 
Business Process Modeling
Business Process ModelingBusiness Process Modeling
Business Process ModelingAng Chen
 
Java Code Generation from Formal Models: The CO-OPN Framework
Java Code Generation from Formal Models: The CO-OPN FrameworkJava Code Generation from Formal Models: The CO-OPN Framework
Java Code Generation from Formal Models: The CO-OPN FrameworkAng Chen
 
Composing Business Process with ID-Net
Composing Business Process with ID-NetComposing Business Process with ID-Net
Composing Business Process with ID-NetAng Chen
 
Prototyping Business Processes
Prototyping Business ProcessesPrototyping Business Processes
Prototyping Business ProcessesAng Chen
 
Towards Service-based Business Process Modeling, Prototyping and Integration
Towards Service-based Business Process Modeling, Prototyping and IntegrationTowards Service-based Business Process Modeling, Prototyping and Integration
Towards Service-based Business Process Modeling, Prototyping and IntegrationAng Chen
 

Plus de Ang Chen (10)

Defence: A multi-dimensional compositional approach for business process (sem...
Defence: A multi-dimensional compositional approach for business process (sem...Defence: A multi-dimensional compositional approach for business process (sem...
Defence: A multi-dimensional compositional approach for business process (sem...
 
A Multi-Dimensional Compositional Approach for Business Process Engineering
A Multi-Dimensional Compositional Approach for Business Process EngineeringA Multi-Dimensional Compositional Approach for Business Process Engineering
A Multi-Dimensional Compositional Approach for Business Process Engineering
 
A Proposition for Business Process Modeling
A Proposition for Business Process ModelingA Proposition for Business Process Modeling
A Proposition for Business Process Modeling
 
Synchronized Composition Of Labeled Transition SystemTS
Synchronized Composition Of Labeled Transition SystemTSSynchronized Composition Of Labeled Transition SystemTS
Synchronized Composition Of Labeled Transition SystemTS
 
Semantics (requirements) of Business Process
Semantics (requirements) of Business ProcessSemantics (requirements) of Business Process
Semantics (requirements) of Business Process
 
Business Process Modeling
Business Process ModelingBusiness Process Modeling
Business Process Modeling
 
Java Code Generation from Formal Models: The CO-OPN Framework
Java Code Generation from Formal Models: The CO-OPN FrameworkJava Code Generation from Formal Models: The CO-OPN Framework
Java Code Generation from Formal Models: The CO-OPN Framework
 
Composing Business Process with ID-Net
Composing Business Process with ID-NetComposing Business Process with ID-Net
Composing Business Process with ID-Net
 
Prototyping Business Processes
Prototyping Business ProcessesPrototyping Business Processes
Prototyping Business Processes
 
Towards Service-based Business Process Modeling, Prototyping and Integration
Towards Service-based Business Process Modeling, Prototyping and IntegrationTowards Service-based Business Process Modeling, Prototyping and Integration
Towards Service-based Business Process Modeling, Prototyping and Integration
 

Dernier

Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 

Dernier (20)

Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 

Jsp & Ajax

  • 1. HTTP, JSP, and AJAX Ang Chen CUI, University of Geneva PINFO 05-06 May 8, 2006
  • 2. Outline Introduction Overview WEB 1.0 vs WEB 2.0 HTTP, CGI, Web Application Model HTTP Common Gateway Interface (CGI) Web Application Model Summary Servlet & JSP Servlet Java Server Pages AJAX Using AJAX Summary Resources
  • 3. Outline Introduction Overview WEB 1.0 vs WEB 2.0 HTTP, CGI, Web Application Model HTTP Common Gateway Interface (CGI) Web Application Model Summary Servlet & JSP Servlet Java Server Pages AJAX Using AJAX Summary Resources
  • 4. Overview This presentation provides a brief introduction of: HTTP, CGI, Web Application Model Servlets & JSP AJAX What it does not include (many!) but can be found in references: Complete technical details, APIs: e.g Taglib, JavaScript, HTML, DOM How to configure Tomcat and deploy applications How to manage sessions with cookies and URL rewriting. How to use JavaBeans in JSP Development Frameworks with JSP and AJAX, e.g. Struts, various AJAX frameworks.
  • 5. WEB 1.0 vs WEB 2.0 Technically, they are the same. ”Old wine in a new bottle.” But, the Use Cases are different. WEB 1.0: User browses the content on the server(the Web), the server(the Web) return the desired content. The Internet Content Provider(ICP) provides the contents to clients. WEB 2.0: User reads and write content from/to the Web. Most contents are provided by Internet users. The Web as Platform.
  • 6. WEB 2.0 Example of WEB 2.0: WebBlog, Social Networks, Contents Sharing, Wiki, RSS (Really Simple Syndication), PodCast Google Maps, Gmail, AdSense, Writely, Flickr, del.icio.us, eBay, Amazon, BitTorrent Keywords of WEB 2.0: Sharing, Tagging, Syndication, Blogging, Services, Simplicity, Re-usability Note that sometimes the term WEB 2.0 is more marketing than its real sense.
  • 7. Outline Introduction Overview WEB 1.0 vs WEB 2.0 HTTP, CGI, Web Application Model HTTP Common Gateway Interface (CGI) Web Application Model Summary Servlet & JSP Servlet Java Server Pages AJAX Using AJAX Summary Resources
  • 8. HTTP: Hypertext Transfer Protocol I A generic protocol for data transfer across the Internet, RFC 2616. HTTP Extensions and HTTP 1.1 are stable specifications and W3C has closed the HTTP Activity. Client/Server architecture: the client sends a request, the server responses. The protocol consists of several parts: communication, access authentication, message format, encoding, caching, etc.
  • 9. HTTP: Hypertext Transfer Protocol I A generic protocol for data transfer across the Internet, RFC 2616. HTTP Extensions and HTTP 1.1 are stable specifications and W3C has closed the HTTP Activity. Client/Server architecture: the client sends a request, the server responses. The protocol consists of several parts: communication, access authentication, message format, encoding, caching, etc.
  • 10. HTTP: Hypertext Transfer Protocol I A generic protocol for data transfer across the Internet, RFC 2616. HTTP Extensions and HTTP 1.1 are stable specifications and W3C has closed the HTTP Activity. Client/Server architecture: the client sends a request, the server responses. The protocol consists of several parts: communication, access authentication, message format, encoding, caching, etc.
  • 11. HTTP: Hypertext Transfer Protocol II To write Web applications, we are interested in the most used communication primitives between the client(browser) and the Web server: GET: retrieve the information identified by the Request-URI. POST: providing a block of data to server, e.g. posting a message, filling a form, etc. PUT: request to store the enclosed entity under the Request-URI, e.g. uploading a file. DELETE: request to delete the resource identified by the Request-URI, e.g. deleting an uploaded file.
  • 12. HTTP: Hypertext Transfer Protocol II To write Web applications, we are interested in the most used communication primitives between the client(browser) and the Web server: GET: retrieve the information identified by the Request-URI. POST: providing a block of data to server, e.g. posting a message, filling a form, etc. PUT: request to store the enclosed entity under the Request-URI, e.g. uploading a file. DELETE: request to delete the resource identified by the Request-URI, e.g. deleting an uploaded file.
  • 13. HTTP: Hypertext Transfer Protocol II To write Web applications, we are interested in the most used communication primitives between the client(browser) and the Web server: GET: retrieve the information identified by the Request-URI. POST: providing a block of data to server, e.g. posting a message, filling a form, etc. PUT: request to store the enclosed entity under the Request-URI, e.g. uploading a file. DELETE: request to delete the resource identified by the Request-URI, e.g. deleting an uploaded file.
  • 14. HTTP: Hypertext Transfer Protocol II To write Web applications, we are interested in the most used communication primitives between the client(browser) and the Web server: GET: retrieve the information identified by the Request-URI. POST: providing a block of data to server, e.g. posting a message, filling a form, etc. PUT: request to store the enclosed entity under the Request-URI, e.g. uploading a file. DELETE: request to delete the resource identified by the Request-URI, e.g. deleting an uploaded file.
  • 15. Common Gateway Interface (CGI) I CGI is a standard for interfacing external applications with information servers, such as HTTP or Web servers. Very important evolution: Static pages -> dynamic pages CGI programs can be written by using any programming languages with input/output, e.g. C, C++, Perl, Shell, Fortran, TCL ...
  • 16. Common Gateway Interface (CGI) II But CGI has the following problems: Performance: each CGI program instance is a process of operation system, i.e. for each request from client, the OS create a process. Security: a Web application, as it is a normal application, can block or crash the server. Manageability: difficult to manage the set of CGI programs and connect them together.
  • 17. Common Gateway Interface (CGI) II But CGI has the following problems: Performance: each CGI program instance is a process of operation system, i.e. for each request from client, the OS create a process. Security: a Web application, as it is a normal application, can block or crash the server. Manageability: difficult to manage the set of CGI programs and connect them together.
  • 18. Common Gateway Interface (CGI) II But CGI has the following problems: Performance: each CGI program instance is a process of operation system, i.e. for each request from client, the OS create a process. Security: a Web application, as it is a normal application, can block or crash the server. Manageability: difficult to manage the set of CGI programs and connect them together.
  • 19. Web Application Model Web Application Models are proposed for the separation of responsibilities between the Web server and Web application, and how to collaborate to get better performance. Easy to be managed, Web applications are homogeneous and securer. More efficient, e.g using thread pool to manage the application instances. Use the Inverse of Control principle. Examples: Apache modules (for php, perl etc.), Web application container (e.g. Tomcat). With the same approach: Application Server (AS), e.g. Enterprise JavaBean container.
  • 20. Summary HTTP for : client / server communication CGI for : Web server / Application Integration JSP / Servlet : a model used for creating Java Web applications. Using the container model. We proceed with JSP/Servlet.
  • 21. Summary HTTP for : client / server communication CGI for : Web server / Application Integration JSP / Servlet : a model used for creating Java Web applications. Using the container model. We proceed with JSP/Servlet.
  • 22. Summary HTTP for : client / server communication CGI for : Web server / Application Integration JSP / Servlet : a model used for creating Java Web applications. Using the container model. We proceed with JSP/Servlet.
  • 23. Summary HTTP for : client / server communication CGI for : Web server / Application Integration JSP / Servlet : a model used for creating Java Web applications. Using the container model. We proceed with JSP/Servlet.
  • 24. Outline Introduction Overview WEB 1.0 vs WEB 2.0 HTTP, CGI, Web Application Model HTTP Common Gateway Interface (CGI) Web Application Model Summary Servlet & JSP Servlet Java Server Pages AJAX Using AJAX Summary Resources
  • 25. Java Web Application Model Web Server Web Application Container request/response Web Application Web Application /app1 /app2 servlet servlet request handling servlet servlet client servlet servlet Server side Service Invocation Server Side Apps Database Figure: Java Web Application Model
  • 26. Java Web Application Model There are several levels of scope, where each one has its parameters: Container: system-wide configuration Application: application configuration and parameters Servlet: servlet information and parameters Page: information related with a JSP Session: session information can cross pages and servlets, session can be used to store objects Each level is modeled by a Java class or interface. (Implicit objects in JSP)
  • 27. Interface javax.servlet.Servlet This interface defines methods to initialize a servlet, to service requests, and to remove a servlet from the server: The servlet is constructed, then initialized with the init method. Any calls from clients to the service method are handled. The servlet is taken out of service, then destroyed with the destroy method, then garbage collected and finalized. In addition to the life-cycle methods, this interface provides the getServletConfig method, which the servlet can use to get any startup information, and the getServletInfo method, which allows the servlet to return basic information about itself, such as author, version, and copyright.
  • 28. Abstract Class javax.servlet.GenericServlet The abstract class GenericServlet defines a generic, protocol-independent servlet. It implements the Servlet and ServletConfig interface. It provides simple versions of the lifecycle methods init and destroy and of the methods in the ServletConfig interface. GenericServlet also implements the log method, declared in the ServletContext interface. To write a generic servlet, you need only override the abstract service method. HttpServlet is a subclass of GenericServlet using HTTP protocol.
  • 29. Abstract class javax.servlet.http.HttpServlet The abstract class HttpServlet is designed to be subclassed to create an HTTP servlet suitable for a Web site. A subclass of HttpServlet must override at least one method, usually one of these: doGet, if the servlet supports HTTP GET requests doPost, for HTTP POST requests doPut, for HTTP PUT requests doDelete, for HTTP DELETE requests init and destroy, to manage resources that are held for the life of the servlet getServletInfo, which the servlet uses to provide information about itself
  • 30. Abstract class javax.servlet.http.HttpServlet The abstract class HttpServlet is designed to be subclassed to create an HTTP servlet suitable for a Web site. A subclass of HttpServlet must override at least one method, usually one of these: doGet, if the servlet supports HTTP GET requests doPost, for HTTP POST requests doPut, for HTTP PUT requests doDelete, for HTTP DELETE requests init and destroy, to manage resources that are held for the life of the servlet getServletInfo, which the servlet uses to provide information about itself
  • 31. Abstract class javax.servlet.http.HttpServlet The abstract class HttpServlet is designed to be subclassed to create an HTTP servlet suitable for a Web site. A subclass of HttpServlet must override at least one method, usually one of these: doGet, if the servlet supports HTTP GET requests doPost, for HTTP POST requests doPut, for HTTP PUT requests doDelete, for HTTP DELETE requests init and destroy, to manage resources that are held for the life of the servlet getServletInfo, which the servlet uses to provide information about itself
  • 32. Abstract class javax.servlet.http.HttpServlet The abstract class HttpServlet is designed to be subclassed to create an HTTP servlet suitable for a Web site. A subclass of HttpServlet must override at least one method, usually one of these: doGet, if the servlet supports HTTP GET requests doPost, for HTTP POST requests doPut, for HTTP PUT requests doDelete, for HTTP DELETE requests init and destroy, to manage resources that are held for the life of the servlet getServletInfo, which the servlet uses to provide information about itself
  • 33. Abstract class javax.servlet.http.HttpServlet The abstract class HttpServlet is designed to be subclassed to create an HTTP servlet suitable for a Web site. A subclass of HttpServlet must override at least one method, usually one of these: doGet, if the servlet supports HTTP GET requests doPost, for HTTP POST requests doPut, for HTTP PUT requests doDelete, for HTTP DELETE requests init and destroy, to manage resources that are held for the life of the servlet getServletInfo, which the servlet uses to provide information about itself
  • 34. Abstract class javax.servlet.http.HttpServlet The abstract class HttpServlet is designed to be subclassed to create an HTTP servlet suitable for a Web site. A subclass of HttpServlet must override at least one method, usually one of these: doGet, if the servlet supports HTTP GET requests doPost, for HTTP POST requests doPut, for HTTP PUT requests doDelete, for HTTP DELETE requests init and destroy, to manage resources that are held for the life of the servlet getServletInfo, which the servlet uses to provide information about itself
  • 35. Writing a HttpServlet A Servlet which returns ”Hello World” to the browser import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class HelloWorld extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { PrintWriter out = response.getWriter(); out.println(quot;Hello Worldquot;); } public String getServletInfo() { return quot;Hello world example for PINFOquot;; } }
  • 36. Writing a HttpServlet II Return HTML content import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class HelloWorld extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType(quot;text/htmlquot;); // set HTTP response content type PrintWriter out = response.getWriter(); out.println(quot;<!DOCTYPE HTML PUBLIC quot;-//W3C//DTD HTML 4.0 quot; + quot;Transitional//ENquot;>nquot; + quot;<HTML>nquot; + quot;<HEAD><TITLE>Hello WWW</TITLE></HEAD>nquot; + quot;<BODY>nquot; + quot;<H1>Hello WWW</H1>nquot; + quot;</BODY></HTML>quot;); } public String getServletInfo() { return quot;Hello world example for PINFOquot;; } }
  • 37. Get the value of the request parameter HttpServletRequest class Request URL: http://localhost:8080/list.jsp?category=pinfo05 public void doGet(HttpServletRequest request, HttpServletResponse response) throws ... { ... String cat = request.getParameter(quot;categoryquot;); ...} cat will have value ”pinfo05”. It works for both GET and POST requests. Two important classes: HttpServletRequest contains information about the request; HttpServletResponse is used to generate HTTP response.
  • 38. Java Server Pages Java Server Pages A way of creating dynamic pages with Java and HTML. Principle: Java for application logic, HTML for presentation. JSP uses HTML for page rendering, and provides several ways to use Java components: Scriptlet: Java codes enclosed by <% and %> Taglib: customized JSP tags Using JavaBeans JSP are translated into Java servlets before they are compiled by the Web application container. HttpServletRequest and HttpServletResponse are implicit objects in JSP.
  • 39. Implicit Objects in Java Server Page The following variables can be directly used in JSP: page: jsp.HttpJspPage : Page’s servlet instance config: ServletConfig : Servlet configuration information pageContext: jsp.pageContext : Provides access to all the namespaces associated with a JSP page and access to several page attributes request: http.HttpServletRequest : Data included with the HTTP Request response: http.HttpServletResponse : HTTP Response data, e.g. cookies out: jsp.JspWriter : Output stream for page context session: http.HttpSession : User specific session data application: ServletContext : Data shared by all application pages
  • 40. Implicit Objects in Java Server Page The following variables can be directly used in JSP: page: jsp.HttpJspPage : Page’s servlet instance config: ServletConfig : Servlet configuration information pageContext: jsp.pageContext : Provides access to all the namespaces associated with a JSP page and access to several page attributes request: http.HttpServletRequest : Data included with the HTTP Request response: http.HttpServletResponse : HTTP Response data, e.g. cookies out: jsp.JspWriter : Output stream for page context session: http.HttpSession : User specific session data application: ServletContext : Data shared by all application pages
  • 41. Implicit Objects in Java Server Page The following variables can be directly used in JSP: page: jsp.HttpJspPage : Page’s servlet instance config: ServletConfig : Servlet configuration information pageContext: jsp.pageContext : Provides access to all the namespaces associated with a JSP page and access to several page attributes request: http.HttpServletRequest : Data included with the HTTP Request response: http.HttpServletResponse : HTTP Response data, e.g. cookies out: jsp.JspWriter : Output stream for page context session: http.HttpSession : User specific session data application: ServletContext : Data shared by all application pages
  • 42. Implicit Objects in Java Server Page The following variables can be directly used in JSP: page: jsp.HttpJspPage : Page’s servlet instance config: ServletConfig : Servlet configuration information pageContext: jsp.pageContext : Provides access to all the namespaces associated with a JSP page and access to several page attributes request: http.HttpServletRequest : Data included with the HTTP Request response: http.HttpServletResponse : HTTP Response data, e.g. cookies out: jsp.JspWriter : Output stream for page context session: http.HttpSession : User specific session data application: ServletContext : Data shared by all application pages
  • 43. Implicit Objects in Java Server Page The following variables can be directly used in JSP: page: jsp.HttpJspPage : Page’s servlet instance config: ServletConfig : Servlet configuration information pageContext: jsp.pageContext : Provides access to all the namespaces associated with a JSP page and access to several page attributes request: http.HttpServletRequest : Data included with the HTTP Request response: http.HttpServletResponse : HTTP Response data, e.g. cookies out: jsp.JspWriter : Output stream for page context session: http.HttpSession : User specific session data application: ServletContext : Data shared by all application pages
  • 44. Implicit Objects in Java Server Page The following variables can be directly used in JSP: page: jsp.HttpJspPage : Page’s servlet instance config: ServletConfig : Servlet configuration information pageContext: jsp.pageContext : Provides access to all the namespaces associated with a JSP page and access to several page attributes request: http.HttpServletRequest : Data included with the HTTP Request response: http.HttpServletResponse : HTTP Response data, e.g. cookies out: jsp.JspWriter : Output stream for page context session: http.HttpSession : User specific session data application: ServletContext : Data shared by all application pages
  • 45. Implicit Objects in Java Server Page The following variables can be directly used in JSP: page: jsp.HttpJspPage : Page’s servlet instance config: ServletConfig : Servlet configuration information pageContext: jsp.pageContext : Provides access to all the namespaces associated with a JSP page and access to several page attributes request: http.HttpServletRequest : Data included with the HTTP Request response: http.HttpServletResponse : HTTP Response data, e.g. cookies out: jsp.JspWriter : Output stream for page context session: http.HttpSession : User specific session data application: ServletContext : Data shared by all application pages
  • 46. Implicit Objects in Java Server Page The following variables can be directly used in JSP: page: jsp.HttpJspPage : Page’s servlet instance config: ServletConfig : Servlet configuration information pageContext: jsp.pageContext : Provides access to all the namespaces associated with a JSP page and access to several page attributes request: http.HttpServletRequest : Data included with the HTTP Request response: http.HttpServletResponse : HTTP Response data, e.g. cookies out: jsp.JspWriter : Output stream for page context session: http.HttpSession : User specific session data application: ServletContext : Data shared by all application pages
  • 47. Outline Introduction Overview WEB 1.0 vs WEB 2.0 HTTP, CGI, Web Application Model HTTP Common Gateway Interface (CGI) Web Application Model Summary Servlet & JSP Servlet Java Server Pages AJAX Using AJAX Summary Resources
  • 48. Asynchronous JavaScript And XML (AJAX) AJAX incorporates several technologies: standards-based presentation using XHTML and CSS; dynamic display and interaction using the Document Object Model; data interchange and manipulation using XML and XSLT; asynchronous data retrieval using XMLHttpRequest; and JavaScript binding everything together. www.w3schools.com provides tutorials for XHTML, CSS, DOM, XML, AJAX, JavaScript etc.
  • 49. Asynchronous JavaScript And XML (AJAX) AJAX incorporates several technologies: standards-based presentation using XHTML and CSS; dynamic display and interaction using the Document Object Model; data interchange and manipulation using XML and XSLT; asynchronous data retrieval using XMLHttpRequest; and JavaScript binding everything together. www.w3schools.com provides tutorials for XHTML, CSS, DOM, XML, AJAX, JavaScript etc.
  • 50. Asynchronous JavaScript And XML (AJAX) AJAX incorporates several technologies: standards-based presentation using XHTML and CSS; dynamic display and interaction using the Document Object Model; data interchange and manipulation using XML and XSLT; asynchronous data retrieval using XMLHttpRequest; and JavaScript binding everything together. www.w3schools.com provides tutorials for XHTML, CSS, DOM, XML, AJAX, JavaScript etc.
  • 51. Asynchronous JavaScript And XML (AJAX) AJAX incorporates several technologies: standards-based presentation using XHTML and CSS; dynamic display and interaction using the Document Object Model; data interchange and manipulation using XML and XSLT; asynchronous data retrieval using XMLHttpRequest; and JavaScript binding everything together. www.w3schools.com provides tutorials for XHTML, CSS, DOM, XML, AJAX, JavaScript etc.
  • 52. Asynchronous JavaScript And XML (AJAX) AJAX incorporates several technologies: standards-based presentation using XHTML and CSS; dynamic display and interaction using the Document Object Model; data interchange and manipulation using XML and XSLT; asynchronous data retrieval using XMLHttpRequest; and JavaScript binding everything together. www.w3schools.com provides tutorials for XHTML, CSS, DOM, XML, AJAX, JavaScript etc.
  • 53. AJAX: Connect HTML with JavaScript Capture Events on HTML pages Mouse event (with elements): mouse down, mouse up, mouse move, mouse over ... Keyboard event: key pressed ... Form: submitted ... Timer etc. Example: Call the getListByCategory function when the mouse is moved over the hyper linked text, and call the function cleanTable when the moused is moved out the link. <a href=quot;/quot; onmouseover=quot;getListByCategory()quot; onmouseout=quot;clearTable()quot;>Show Member List</a>
  • 54. AJAX: Create XMLHttpRequest Object This function will create an XMLHttpRequest object and send a GET request to the server page http://pinfo.unige.ch:8080/Member/list.jsp with parameter category with value pinfo05. Send a HTTP request via XMLHttpRequest Object: function getListByCategory() { var req = false; var self = this; var url = quot;http://pinfo.unige.ch:8080/Member/list.jsp?category=pinfo05quot;; if (window.XMLHttpRequest) { self.req = new XMLHttpRequest(); // for Firefox and other browsers } else if (window.ActiveXObject) { self.req = new ActiveXObject(quot;Microsoft.XMLHTTPquot;); // for IE browser } // when the request is finished, call this function self.req.onreadystatechange = processRequest; self.req.open(quot;GETquot;, url, true); // it is a GET request self.req.send(null); // send the request } Note that the implementation of XMLHttpRequest is different from one browser to another.
  • 55. AJAX: Handling Asynchronous Response A node is tagged with id ”result” in the HTML document <div id=result></div> The function processRequest is called when the XMLHttpRequest is finished (asynchronous response). function processRequest() { // check the request state is quot;completequot; if (req.readyState == 4 || req.readyState == quot;completequot;) { if (req.status == 200) { updatepage(self.req.responseText); } else { alert(quot;Not able to retrieve member listquot;); } } } // Just set the content of note with id quot;resultquot; with the input parameter // Other DOM and XML operations are possible, here it is simplified. function updatepage(str) { document.getElementById(quot;resultquot;).innerHTML = str; }
  • 56. AJAX: Web Application Model Figure: AJAX Web Application Model
  • 57. AJAX: Interactions Figure: AJAX Interactions
  • 58. Outline Introduction Overview WEB 1.0 vs WEB 2.0 HTTP, CGI, Web Application Model HTTP Common Gateway Interface (CGI) Web Application Model Summary Servlet & JSP Servlet Java Server Pages AJAX Using AJAX Summary Resources
  • 59. Summary Web Application Model: relations between client, Web server, server side application, and web application. The Application Container model is mature. JSP and Servlets provide server side programming facilities: reusability, manageability, security etc. AJAX provides a standard solution for client/server interaction: XML based, Asynchronous, no page refresh needed. It is the most used technology in WEB 2.0. AJAX is the complement for the presentation layer of Web applications with JSP: JSP provides services, AJAX use these services, messages are in XML, communication via HTTP. WEB 2.0 is more than AJAX.
  • 60. Summary Web Application Model: relations between client, Web server, server side application, and web application. The Application Container model is mature. JSP and Servlets provide server side programming facilities: reusability, manageability, security etc. AJAX provides a standard solution for client/server interaction: XML based, Asynchronous, no page refresh needed. It is the most used technology in WEB 2.0. AJAX is the complement for the presentation layer of Web applications with JSP: JSP provides services, AJAX use these services, messages are in XML, communication via HTTP. WEB 2.0 is more than AJAX.
  • 61. Summary Web Application Model: relations between client, Web server, server side application, and web application. The Application Container model is mature. JSP and Servlets provide server side programming facilities: reusability, manageability, security etc. AJAX provides a standard solution for client/server interaction: XML based, Asynchronous, no page refresh needed. It is the most used technology in WEB 2.0. AJAX is the complement for the presentation layer of Web applications with JSP: JSP provides services, AJAX use these services, messages are in XML, communication via HTTP. WEB 2.0 is more than AJAX.
  • 62. Summary Web Application Model: relations between client, Web server, server side application, and web application. The Application Container model is mature. JSP and Servlets provide server side programming facilities: reusability, manageability, security etc. AJAX provides a standard solution for client/server interaction: XML based, Asynchronous, no page refresh needed. It is the most used technology in WEB 2.0. AJAX is the complement for the presentation layer of Web applications with JSP: JSP provides services, AJAX use these services, messages are in XML, communication via HTTP. WEB 2.0 is more than AJAX.
  • 63. Summary Web Application Model: relations between client, Web server, server side application, and web application. The Application Container model is mature. JSP and Servlets provide server side programming facilities: reusability, manageability, security etc. AJAX provides a standard solution for client/server interaction: XML based, Asynchronous, no page refresh needed. It is the most used technology in WEB 2.0. AJAX is the complement for the presentation layer of Web applications with JSP: JSP provides services, AJAX use these services, messages are in XML, communication via HTTP. WEB 2.0 is more than AJAX.
  • 64. Summary Web Application Model: relations between client, Web server, server side application, and web application. The Application Container model is mature. JSP and Servlets provide server side programming facilities: reusability, manageability, security etc. AJAX provides a standard solution for client/server interaction: XML based, Asynchronous, no page refresh needed. It is the most used technology in WEB 2.0. AJAX is the complement for the presentation layer of Web applications with JSP: JSP provides services, AJAX use these services, messages are in XML, communication via HTTP. WEB 2.0 is more than AJAX.
  • 65. Outline Introduction Overview WEB 1.0 vs WEB 2.0 HTTP, CGI, Web Application Model HTTP Common Gateway Interface (CGI) Web Application Model Summary Servlet & JSP Servlet Java Server Pages AJAX Using AJAX Summary Resources
  • 66. Servlet, JSP Specifications: Java Servlet Specifications JSP Technology Tutorial: Basic Servlets: http://www.apl.jhu.edu/ hall/java/Servlet-Tutorial/ MoreServlets Book & Tutorials: Servlet, JSP, Taglib, Struts, AJAX
  • 67. AJAX, WEB 2.0 AJAX: Ajax: A New Approach to Web Applications AJAX: Getting Started, mozilla developer center Top 10 Ajax Applications AJAX Tutorial AJAX Login System Demo Guide to Using AJAX and XMLHttpRequest Ajaxian WEB 2.0 O’Reilly: What Is Web 2.0 The Best Web 2.0 Software of 2005 Writly Google Earth