Servlets Information - SERVLET PROGRAMMING Agenda Overview...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: SERVLET PROGRAMMING Agenda Overview of Servlets Overview of Servlet APIs Servlet LifeCycle Request and Responses Serving Static HTML Web servers where designed to provide web browsers with HTML. The HTML was read from text files by the server and sent to the client using HTTP. The web server does not modify the HTML. This is now termed static HTML serving Client Machine Server Machine Web Browser Web Server HTML doGet or doPost HTML HTML Web Page on disk The Solution Run an external program to generate the HTML A better choice is to arrange it so that when a certain web page is accessed an external program is run by the web server and that program generates the HTML => web server must know how to run and communicate with application. This process is transparent to the web browser. It just receives HTML and does not know it has been dynamically generated => web browser does not need to be modified CGI C ommon G ateway I nterface is one way for a web server to run external applications. Servlets is another way. Client Machine Server Machine Web Browser Web Server HTML doGet or doPost HTML Information about the request External HTML generator HTML Servlets - a solution for dynamically generating HTML Servlets are programs written in Java which run on the web server and communicate using with the web browser using HTTP and HTML Servlets are compatible with all web browsers because servlets communicate with the browser using only HTML and HTTP Servlets are simple to write because they are written in standard Java Most of the communication is done for you by the Servlet class. No need to mess around with Sockets, TCP/IP or Java serialisation. Servlets run only on the server and therefore do not need Java any other programming language to be installed on the client Servlets do need the servlet to be stored or installed on the Servlets have six main advantages: Efficient Convenient Powerful Portable Secure Inexpensive Advantages of Servlets Advantage 1: Efficient For each browser request, the servlet spawns a light weight thread. This is faster and more efficient that spawning a new operating system process. Hence, servlets have better performance and better scalability than traditional CGI. Advantage 2: Convenient Servlets include built-in functionality for: Reading HTML form data Handling cookies Tracking user sessions Setting HTTP headers Java is object oriented Advantage 3: Powerful Servlets can talk directly to the web servers. Multiple servlets can share data: Particularly important for maintaining database connections....
View Full Document

This note was uploaded on 06/27/2011 for the course COMPUTER S 133 taught by Professor Andrewstrauss during the Spring '11 term at Bucks Community College.

Page1 / 39

Servlets Information - SERVLET PROGRAMMING Agenda Overview...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online