HTTP, JSP, and AJAX
Ang Chen
CUI, University of Geneva
PINFO 05-06 May 5, 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:
I HTTP, CGI, Web Application Model
I Servlets & JSP
I AJAX
What it does not include (many!) but can be found in references:
I Complete technical details, APIs: e.g Taglib, JavaScript,
HTML, DOM
I How to configure Tomcat and deploy applications
I How to manage sessions with cookies and URL rewriting.
I How to use JavaBeans in JSP
I 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:
I User browses the content on the server(the Web), the
server(the Web) return the desired content.
I The Internet Content Provider(ICP) provides the contents to
clients.
WEB 2.0:
I User reads and write content from/to the Web.
I Most contents are provided by Internet users. The Web as
Platform.
WEB 2.0
Example of WEB 2.0:
I WebBlog, Social Networks, Contents Sharing, Wiki, RSS
(Really Simple Syndication), PodCast
I Google Maps, Gmail, AdSense, Writely, Flickr, del.icio.us,
eBay, Amazon, BitTorrent
Keywords of WEB 2.0:
I Sharing, Tagging, Syndication, Blogging,
I 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
I A generic protocol for data transfer across the Internet, RFC
2616.
I HTTP Extensions and HTTP 1.1 are stable specifications and
W3C has closed the HTTP Activity.
I 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
I A generic protocol for data transfer across the Internet, RFC
2616.
I HTTP Extensions and HTTP 1.1 are stable specifications and
W3C has closed the HTTP Activity.
I 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
I A generic protocol for data transfer across the Internet, RFC
2616.
I HTTP Extensions and HTTP 1.1 are stable specifications and
W3C has closed the HTTP Activity.
I 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:
I GET: retrieve the information identified by the Request-URI.
I POST: providing a block of data to server, e.g. posting a
message, filling a form, etc.
I PUT: request to store the enclosed entity under the
Request-URI, e.g. uploading a file.
I 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:
I GET: retrieve the information identified by the Request-URI.
I POST: providing a block of data to server, e.g. posting a
message, filling a form, etc.
I PUT: request to store the enclosed entity under the
Request-URI, e.g. uploading a file.
I 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:
I GET: retrieve the information identified by the Request-URI.
I POST: providing a block of data to server, e.g. posting a
message, filling a form, etc.
I PUT: request to store the enclosed entity under the
Request-URI, e.g. uploading a file.
I 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:
I GET: retrieve the information identified by the Request-URI.
I POST: providing a block of data to server, e.g. posting a
message, filling a form, etc.
I PUT: request to store the enclosed entity under the
Request-URI, e.g. uploading a file.
I 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:
I Performance: each CGI program instance is a process of
operation system, i.e. for each request from client, the OS
create a process.
I Security: a Web application, as it is a normal application, can
block or crash the server.
I Manageability: difficult to manage the set of CGI programs
and connect them together.
Common Gateway Interface (CGI) II
But CGI has the following problems:
I Performance: each CGI program instance is a process of
operation system, i.e. for each request from client, the OS
create a process.
I Security: a Web application, as it is a normal application, can
block or crash the server.
I Manageability: difficult to manage the set of CGI programs
and connect them together.
Common Gateway Interface (CGI) II
But CGI has the following problems:
I Performance: each CGI program instance is a process of
operation system, i.e. for each request from client, the OS
create a process.
I Security: a Web application, as it is a normal application, can
block or crash the server.
I 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.
I Easy to be managed, Web applications are homogeneous and
securer.
I More efficient, e.g using thread pool to manage the
application instances.
I Use the Inverse of Control principle.
I Examples: Apache modules (for php, perl etc.), Web
application container (e.g. Tomcat).
I With the same approach: Application Server (AS), e.g.
Enterprise JavaBean container.
Summary
I HTTP for : client / server communication
I CGI for : Web server / Application Integration
I JSP / Servlet : a model used for creating Java Web
applications. Using the container model.
I We proceed with JSP/Servlet.
Summary
I HTTP for : client / server communication
I CGI for : Web server / Application Integration
I JSP / Servlet : a model used for creating Java Web
applications. Using the container model.
I We proceed with JSP/Servlet.
Summary
I HTTP for : client / server communication
I CGI for : Web server / Application Integration
I JSP / Servlet : a model used for creating Java Web
applications. Using the container model.
I We proceed with JSP/Servlet.
Summary
I HTTP for : client / server communication
I CGI for : Web server / Application Integration
I JSP / Servlet : a model used for creating Java Web
applications. Using the container model.
I 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
Web Application Web Application request/response
/app1 /app2
servlet servlet request
handling
servlet servlet
servlet servlet client
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:
I Container: system-wide configuration
I Application: application configuration and parameters
I Servlet: servlet information and parameters
I Page: information related with a JSP
I 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:
I The servlet is constructed, then initialized with the init
method.
I Any calls from clients to the service method are handled.
I 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.
I It implements the Servlet and ServletConfig interface.
I 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:
I doGet, if the servlet supports HTTP GET requests
I doPost, for HTTP POST requests
I doPut, for HTTP PUT requests
I doDelete, for HTTP DELETE requests
I init and destroy, to manage resources that are held for the life
of the servlet
I 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:
I doGet, if the servlet supports HTTP GET requests
I doPost, for HTTP POST requests
I doPut, for HTTP PUT requests
I doDelete, for HTTP DELETE requests
I init and destroy, to manage resources that are held for the life
of the servlet
I 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:
I doGet, if the servlet supports HTTP GET requests
I doPost, for HTTP POST requests
I doPut, for HTTP PUT requests
I doDelete, for HTTP DELETE requests
I init and destroy, to manage resources that are held for the life
of the servlet
I 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:
I doGet, if the servlet supports HTTP GET requests
I doPost, for HTTP POST requests
I doPut, for HTTP PUT requests
I doDelete, for HTTP DELETE requests
I init and destroy, to manage resources that are held for the life
of the servlet
I 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:
I doGet, if the servlet supports HTTP GET requests
I doPost, for HTTP POST requests
I doPut, for HTTP PUT requests
I doDelete, for HTTP DELETE requests
I init and destroy, to manage resources that are held for the life
of the servlet
I 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:
I doGet, if the servlet supports HTTP GET requests
I doPost, for HTTP POST requests
I doPut, for HTTP PUT requests
I doDelete, for HTTP DELETE requests
I init and destroy, to manage resources that are held for the life
of the servlet
I 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("Hello World");
}
public String getServletInfo() {
return "Hello world example for PINFO";
}
}
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("text/html"); // set HTTP response content type
PrintWriter out = response.getWriter();
out.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 " +
"Transitional//EN\">\n" +
"<HTML>\n" +
"<HEAD><TITLE>Hello WWW</TITLE></HEAD>\n" +
"<BODY>\n" +
"<H1>Hello WWW</H1>\n" +
"</BODY></HTML>");
}
public String getServletInfo() {
return "Hello world example for PINFO";
}
}
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("category");
...}
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:
I Scriptlet: Java codes enclosed by <% and %>
I Taglib: customized JSP tags
I 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:
I page: jsp.HttpJspPage : Page’s servlet instance
I config: ServletConfig : Servlet configuration information
I pageContext: jsp.pageContext : Provides access to all the
namespaces associated with a JSP page and access to several
page attributes
I request: http.HttpServletRequest : Data included with the
HTTP Request
I response: http.HttpServletResponse : HTTP Response data,
e.g. cookies
I out: jsp.JspWriter : Output stream for page context
I session: http.HttpSession : User specific session data
I application: ServletContext : Data shared by all application
pages
Implicit Objects in Java Server Page
The following variables can be directly used in JSP:
I page: jsp.HttpJspPage : Page’s servlet instance
I config: ServletConfig : Servlet configuration information
I pageContext: jsp.pageContext : Provides access to all the
namespaces associated with a JSP page and access to several
page attributes
I request: http.HttpServletRequest : Data included with the
HTTP Request
I response: http.HttpServletResponse : HTTP Response data,
e.g. cookies
I out: jsp.JspWriter : Output stream for page context
I session: http.HttpSession : User specific session data
I application: ServletContext : Data shared by all application
pages
Implicit Objects in Java Server Page
The following variables can be directly used in JSP:
I page: jsp.HttpJspPage : Page’s servlet instance
I config: ServletConfig : Servlet configuration information
I pageContext: jsp.pageContext : Provides access to all the
namespaces associated with a JSP page and access to several
page attributes
I request: http.HttpServletRequest : Data included with the
HTTP Request
I response: http.HttpServletResponse : HTTP Response data,
e.g. cookies
I out: jsp.JspWriter : Output stream for page context
I session: http.HttpSession : User specific session data
I application: ServletContext : Data shared by all application
pages
Implicit Objects in Java Server Page
The following variables can be directly used in JSP:
I page: jsp.HttpJspPage : Page’s servlet instance
I config: ServletConfig : Servlet configuration information
I pageContext: jsp.pageContext : Provides access to all the
namespaces associated with a JSP page and access to several
page attributes
I request: http.HttpServletRequest : Data included with the
HTTP Request
I response: http.HttpServletResponse : HTTP Response data,
e.g. cookies
I out: jsp.JspWriter : Output stream for page context
I session: http.HttpSession : User specific session data
I application: ServletContext : Data shared by all application
pages
Implicit Objects in Java Server Page
The following variables can be directly used in JSP:
I page: jsp.HttpJspPage : Page’s servlet instance
I config: ServletConfig : Servlet configuration information
I pageContext: jsp.pageContext : Provides access to all the
namespaces associated with a JSP page and access to several
page attributes
I request: http.HttpServletRequest : Data included with the
HTTP Request
I response: http.HttpServletResponse : HTTP Response data,
e.g. cookies
I out: jsp.JspWriter : Output stream for page context
I session: http.HttpSession : User specific session data
I application: ServletContext : Data shared by all application
pages
Implicit Objects in Java Server Page
The following variables can be directly used in JSP:
I page: jsp.HttpJspPage : Page’s servlet instance
I config: ServletConfig : Servlet configuration information
I pageContext: jsp.pageContext : Provides access to all the
namespaces associated with a JSP page and access to several
page attributes
I request: http.HttpServletRequest : Data included with the
HTTP Request
I response: http.HttpServletResponse : HTTP Response data,
e.g. cookies
I out: jsp.JspWriter : Output stream for page context
I session: http.HttpSession : User specific session data
I application: ServletContext : Data shared by all application
pages
Implicit Objects in Java Server Page
The following variables can be directly used in JSP:
I page: jsp.HttpJspPage : Page’s servlet instance
I config: ServletConfig : Servlet configuration information
I pageContext: jsp.pageContext : Provides access to all the
namespaces associated with a JSP page and access to several
page attributes
I request: http.HttpServletRequest : Data included with the
HTTP Request
I response: http.HttpServletResponse : HTTP Response data,
e.g. cookies
I out: jsp.JspWriter : Output stream for page context
I session: http.HttpSession : User specific session data
I application: ServletContext : Data shared by all application
pages
Implicit Objects in Java Server Page
The following variables can be directly used in JSP:
I page: jsp.HttpJspPage : Page’s servlet instance
I config: ServletConfig : Servlet configuration information
I pageContext: jsp.pageContext : Provides access to all the
namespaces associated with a JSP page and access to several
page attributes
I request: http.HttpServletRequest : Data included with the
HTTP Request
I response: http.HttpServletResponse : HTTP Response data,
e.g. cookies
I out: jsp.JspWriter : Output stream for page context
I session: http.HttpSession : User specific session data
I 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:
I standards-based presentation using XHTML and CSS;
I dynamic display and interaction using the Document Object
Model;
I data interchange and manipulation using XML and XSLT;
I asynchronous data retrieval using XMLHttpRequest;
I 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:
I standards-based presentation using XHTML and CSS;
I dynamic display and interaction using the Document Object
Model;
I data interchange and manipulation using XML and XSLT;
I asynchronous data retrieval using XMLHttpRequest;
I 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:
I standards-based presentation using XHTML and CSS;
I dynamic display and interaction using the Document Object
Model;
I data interchange and manipulation using XML and XSLT;
I asynchronous data retrieval using XMLHttpRequest;
I 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:
I standards-based presentation using XHTML and CSS;
I dynamic display and interaction using the Document Object
Model;
I data interchange and manipulation using XML and XSLT;
I asynchronous data retrieval using XMLHttpRequest;
I 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:
I standards-based presentation using XHTML and CSS;
I dynamic display and interaction using the Document Object
Model;
I data interchange and manipulation using XML and XSLT;
I asynchronous data retrieval using XMLHttpRequest;
I 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
I Mouse event (with elements): mouse down, mouse up, mouse
move, mouse over ...
I Keyboard event: key pressed ...
I Form: submitted ...
I 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="/" onmouseover="getListByCategory()"
onmouseout="clearTable()">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 = "http://pinfo.unige.ch:8080/Member/list.jsp?category=pinfo05";
if (window.XMLHttpRequest) {
self.req = new XMLHttpRequest(); // for Firefox and other browsers
} else if (window.ActiveXObject) {
self.req = new ActiveXObject("Microsoft.XMLHTTP"); // for IE browser
}
// when the request is finished, call this function
self.req.onreadystatechange = processRequest;
self.req.open("GET", 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 "complete"
if (req.readyState == 4 || req.readyState == "complete") {
if (req.status == 200) {
updatepage(self.req.responseText);
} else {
alert("Not able to retrieve member list");
}
}
}
// Just set the content of note with id "result" with the input parameter
// Other DOM and XML operations are possible, here it is simplified.
function updatepage(str) {
document.getElementById("result").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
I Web Application Model: relations between client, Web server,
server side application, and web application. The Application
Container model is mature.
I JSP and Servlets provide server side programming facilities:
reusability, manageability, security etc.
I 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.
I 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.
I WEB 2.0 is more than AJAX.
Summary
I Web Application Model: relations between client, Web server,
server side application, and web application. The Application
Container model is mature.
I JSP and Servlets provide server side programming facilities:
reusability, manageability, security etc.
I 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.
I 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.
I WEB 2.0 is more than AJAX.
Summary
I Web Application Model: relations between client, Web server,
server side application, and web application. The Application
Container model is mature.
I JSP and Servlets provide server side programming facilities:
reusability, manageability, security etc.
I 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.
I 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.
I WEB 2.0 is more than AJAX.
Summary
I Web Application Model: relations between client, Web server,
server side application, and web application. The Application
Container model is mature.
I JSP and Servlets provide server side programming facilities:
reusability, manageability, security etc.
I 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.
I 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.
I WEB 2.0 is more than AJAX.
Summary
I Web Application Model: relations between client, Web server,
server side application, and web application. The Application
Container model is mature.
I JSP and Servlets provide server side programming facilities:
reusability, manageability, security etc.
I 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.
I 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.
I WEB 2.0 is more than AJAX.
Summary
I Web Application Model: relations between client, Web server,
server side application, and web application. The Application
Container model is mature.
I JSP and Servlets provide server side programming facilities:
reusability, manageability, security etc.
I 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.
I 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.
I 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:
I Java Servlet Specifications
I JSP Technology
Tutorial:
I Basic Servlets:
http://www.apl.jhu.edu/ hall/java/Servlet-Tutorial/
I MoreServlets Book & Tutorials: Servlet, JSP, Taglib, Struts,
AJAX
AJAX, WEB 2.0
AJAX:
I Ajax: A New Approach to Web Applications
I AJAX: Getting Started, mozilla developer center
I Top 10 Ajax Applications
I AJAX Tutorial
I AJAX Login System Demo
I Guide to Using AJAX and XMLHttpRequest
I Ajaxian
WEB 2.0
I O’Reilly: What Is Web 2.0
I The Best Web 2.0 Software of 2005
I Writly
I Google Earth