FACTOID # 58: 22% of American women aged 20 gave birth while in their teens. In Switzerland and Japan, only 2% did so.
 
 Home   Encyclopedia   Statistics   Countries A-Z   Flags   Maps   Education   Forum   FAQ   About 
 
WHAT'S NEW
RECENT ARTICLES
More Recent Articles »
 

Encyclopedia > Java Servlet

The Java Servlet API allows a software developer to add dynamic content to a Web server using the Java platform. The generated content is commonly HTML, but may be other data such as XML. Servlets are the Java counterpart to non-Java dynamic Web content technologies such as PHP, CGI and ASP.NET. Servlets can maintain state across many server transactions by using HTTP cookies, session variables or URL rewriting. A software developer is a person who is concerned with one or more facets of the software development process, a somewhat broader scope of computer programming or a specialty of project managing. ... The inside/front of a Dell PowerEdge web server The term Web server can mean one of two things: A computer program that is responsible for accepting HTTP requests from clients, which are known as Web browsers, and serving them HTTP responses along with optional data contents, which usually are... The Java platform is the name for a computing environment, or platform, from Sun Microsystems which can run applications developed using the Java programming language and set of development tools. ... HTML, short for Hypertext Markup Language, is the predominant markup language for the creation of web pages. ... The Extensible Markup Language (XML) is a general-purpose markup language. ... PHP is a reflective programming language originally designed for producing dynamic web pages. ... The Common Gateway Interface (CGI) is a standard protocol for interfacing external application software with an information server, commonly a web server. ... Active Server Pages (ASP) is Microsofts Server-side script engine for dynamically-generated web pages. ... HTTP cookies, sometimes known as web cookies or just cookies, are parcels of text sent by a server to a web browser and then sent back unchanged by the browser each time it accesses that server. ... In computer science, in particular networking, a session is either a lasting connection using the session layer of a network protocol or a lasting connection between a user (or user agent) and a peer, typically a server, usually involving the exchange of many packets between the users computer and... It has been suggested that this article or section be merged with Rewrite engine. ...


The Servlet API, contained in the Java package hierarchy javax.servlet, defines the expected interactions of a Web container and a servlet. A Web container is essentially the component of a Web server that interacts with the servlets. The Web container is responsible for managing the lifecycle of servlets, mapping a URL to a particular servlet and ensuring that the URL requester has the correct access rights. An application programming interface (API) is a source code interface that a computer system or program library provides to support requests for services to be made of it by a Length. ... A Java package is a Java programming language mechanism for organizing classes into namespaces. ... A servlet container comprises essentially the component of a web server that hosts and interacts with Java servlets. ...


A Servlet is an object that receives a request and generates a response based on that request. The basic servlet package defines Java objects to represent servlet requests and responses, as well as objects to reflect the servlet's configuration parameters and execution environment. The package javax.servlet.http defines HTTP-specific subclasses of the generic servlet elements, including session management objects that track multiple requests and responses between the Web server and a client. Servlets may be packaged in a WAR file as a Web application. In strictly mathematical branches of computer science the term object is used in a purely mathematical sense to refer to any thing. While this interpretation is useful in the discussion of abstract theory, it is not concrete enough to serve as a primitive datatype in the discussion of more concrete... HTTP (for HyperText Transfer Protocol) is the primary method used to convey information on the World Wide Web. ... In computing, a WAR file (short for Web Application Archive) is a ZIP file used to distribute a set of Java classes. ... In software engineering, a web application is an application delivered to users from a web server over a network such as the World Wide Web or an intranet. ...


Servlets can be generated automatically by JavaServer Pages (JSP), or alternately by template engines such as WebMacro. Often servlets are used in conjunction with JSPs in a pattern called "Model 2", which is a flavor of the model-view-controller pattern. JavaServer Pages (JSP) is a Java technology that allows software developers to dynamically generate HTML, XML or other types of documents in response to a Web client request. ... WebMacro is a framework for developing Java Servlets. ... In the design of Java Web applications, there are generally used two design models called Model 1 and Model 2. ... This article or section should include material from Model view controller triad Model-View-Controller (MVC) is a software architecture that separates an applications data model, user interface, and control logic into three distinct components so that modifications to the view component can be made with minimal impact to...

Contents

History

The original servlet specification was created by Sun Microsystems (version 1.0 was finalized in June 1997). Starting with version 2.3, the servlet specification was developed under the Java Community Process. JSR 53 defined both the Servlet 2.3 and JavaServer Page 1.2 specifications. JSR 154 specifies the Servlet 2.4 and 2.5 specifications. As of May 10, 2006, the current version of the servlet specification is 2.5. Sun Microsystems, Inc. ... Year 1997 (MCMXCVII) was a common year starting on Wednesday (link will display full 1997 Gregorian calendar). ... The Java Community Process or JCP, established in 1995, is a formalized process which allows interested parties to be involved in the definition of future versions and features of the Java platform. ...


In his blog on java.net, Sun veteran and GlassFish lead Jim Driscoll details the history of servlet technology. [1] James Gosling first thought of servlets in the early days of Java, but the concept did not become a product until Sun shipped the Java Web Server product. This was before what is now the Java Platform, Enterprise Edition was made into a specification. GlassFish is the name of an open source development project for the next generation Sun Microsystems Java EE server. ... This article or section does not cite any references or sources. ... Java is a programming language originally developed by Sun Microsystems and released in 1995. ... Java Platform, Enterprise Edition or Java EE is a widely used platform for server programming in the Java programming language. ...

Servlet API history
Servlet API version Released Platform Important Changes
Servlet 2.5 September 2005 JavaEE 5 , J2SE 5.0 Requires J2SE 5.0, supports annotations
Servlet 2.4 November 2003 J2EE 1.4, J2SE 1.3 web.xml uses XML Schema
Servlet 2.3 August 2001 J2EE 1.3, J2SE 1.2 Addition of Filters
Servlet 2.2 August 1999 J2EE 1.2, J2SE 1.2 Becomes part of J2EE, introduced independent web applications in .war files
Servlet 2.1 November 1998 Unspecified First official specification, added RequestDispatcher, ServletContext
Servlet 2.0 JDK 1.1 Part of Java Servlet Development Kit 2.0
Servlet 1.0 June 1997

Life Cycle of a Servlet

The Servlet life cycle consists of the following steps:

  1. The Servlet class is loaded by the container during start-up.
  2. The container calls the init() method. This method initializes the servlet and must be called before the servlet can service any requests. In the entire life of a servlet, the init() method is called only once.
  3. After initialization, the servlet can service client-requests. Each request is serviced in its own separate thread. The container calls the service() method of the servlet for every request. The service() method determines the kind of request being made and dispatches it to an appropriate method to handle the request. The developer of the servlet must provide an implementation for these methods. If a request for a method that is not implemented by the servlet is made, the method of the parent class is called, typically resulting in an error being returned to the requester.
  4. Finally, the container calls the destroy() method which takes the servlet out of service. The destroy() method like init() is called only once in the life-cycle of a Servlet.

ServletConfig and ServletContext

There is only one ServletContext in every application. This object can be used by all the servlets to obtain application level information or container details. Every servlet, on the other hand, gets its own ServletConfig object. This object provides initialization parameters for a servlet. A developer can obtain the reference to ServletContext using either the ServletConfig object or ServletRequest object.


Servlet Containers

A Servlet container is a specialized web server that supports Servlet execution. It combines the basic functionality of a web server with certain Java/Servlet specific optimizations and extensions – such as an integrated Java runtime environment, and the ability to automatically translate specific URLs into Servlet requests. Individual Servlets are registered with a Servlet container, providing the container with information about what functionality they provide, and what URL or other resource locator they will use to identify themselves. The Servlet container is then able to initialize the Servlet as necessary and deliver requests to the Servlet as they arrive. Many containers have the ability to dynamically add and remove Servlets from the system, allowing new Servlets to quickly be deployed or removed without affecting other Servlets running from the same container. Servlet containers are also referred to as web containers or web engines.


Like the other Java APIs, different vendors provide their own implementation of the Servlet container standard. Below is a list of some of the free and commercial web containers. (Note that 'free' means that non-commercial use is free. Some of the commercial containers, e.g. Resin and Orion, are free to use in a server environment for non-profit organizations).


Non-commercial web containers

  • Apache Tomcat (formerly Jakarta Tomcat) is an open source web container available free of charge under the Apache Software License. It is used in the official reference implementation and has a reputation for being stable.[citation needed]
  • Geronimo Application Server is a full J2EE implementation by Apache.
  • Jetty
  • Jaminid contains a higher abstraction than servlets.
  • Enhydra
  • jo!
  • Winstone supports specification v2.4, has a focus on minimal configuration and the ability to strip the container down to only what you need.
  • tjws spec 2.4, small footprint, modular design

Apache Tomcat is a web container developed at the Apache Software Foundation (ASF). ... The Apache Software License is an open source license used by the Apache Software Foundation. ... The Geronimo project is a free software application server developed by the Apache Software Foundation and distributed under the Apache license. ... This article is being considered for deletion in accordance with Wikipedias deletion policy. ... Jaminid is the Java Mini Daemon, an open source LGPL HTTP server specifically designed to be embedded in traditional Java applications to create web applications. ... Winstone is a servlet container that was written out of a desire to provide servlet functionality without the bloat that full J2EE compliance introduces. ...

Commercial web containers

Sun Microsystems is a computer, semiconductor and software manufacturer headquartered in Santa Clara, California, in Silicon Valley. ... Sun Javaâ„¢ System Web Server (formerly Sun ONE Web Server, before that iPlanet Web Server, and before that Netscape Enterprise Server) is a web server designed for medium and large business applications. ... BEA Systems, Inc. ... BEA WebLogic is a J2EE application server and also an HTTP web server by BEA Systems of San Jose, California, for Unix, Linux, Microsoft Windows, and other platforms. ... Borland Software Corporation is a software company headquartered in Austin, Texas. ... Oracle Corporation (NASDAQ: ORCL) is one of the major companies developing database management systems (DBMS), tools for database development, middle-tier software, enterprise resource planning software (ERP), customer relationship management software (CRM) and supply chain management (SCM) software. ... Oracle Application Server 10g (g is for Grid), is an integrated, standards-based software platform. ... IBM redirects here. ... WebSphere refers to a brand of proprietary IBM software products, although the term also popularly refers to one specific product: WebSphere Application Server (WAS). ... Adobe Systems (pronounced a-DOE-bee IPA: ) (NASDAQ: ADBE) (LSE: ABS) is an American computer software company headquartered in San Jose, California, USA. Adobe was founded in December 1982[1] by John Warnock and Charles Geschke, who established the company after leaving Xerox PARC in order to develop and sell... JRun is an Macromedias J2EE application server. ... IronFlare AB is a Swedish software company. ... WebObjects is a Java Web application server by Apple Computer. ...

Commercial open source web containers

JBoss (pronounced Jay Boss) is an open source Java EE-based application server implemented in Java. ... GlassFish is the name of an open source development project for the next generation Sun Microsystems Java EE server. ...

See also

JavaServer Pages (JSP) is a Java technology that allows software developers to dynamically generate HTML, XML or other types of documents in response to a Web client request. ... Java Platform, Enterprise Edition or Java EE (formerly known as Java 2 Platform, Enterprise Edition or J2EE up to version 1. ...

External links

Java refers to a number of computer software products and specifications from Sun Microsystems (the Javaâ„¢ technology) that together provide a system for developing and deploying cross-platform applications. ... Java is a programming language originally developed by Sun Microsystems and released in 1995. ... The Java platform is the name for a computing environment, or platform, from Sun Microsystems which can run applications developed using the Java programming language and set of development tools. ... The Java Development Kit (JDK) is a Sun Microsystems product aimed at Java developers. ... A Java Virtual Machine (JVM) is a set of computer software programs and data structures which implements a specific virtual machine model. ... The Java Runtime Environment, or JRE, is a software bundle from Sun Microsystems that allows a computer system to run a Java application. ... GNU Classpath is a project aiming to create a free implementation of the standard class library for the Java programming language. ... The GNU Compiler for Java (GCJ) is a free software compiler for the Java programming language that is part of the GNU Compiler Collection. ... Apache Harmony is an open source implementation of Java, starting with Java SE 5. ... Kaffe is a clean room design of a Java Virtual Machine. ... Java Web Start, first introduced for J2SE 1. ... The Java programming language was intended to serve as a novel way to manage software complexity. ... The Java Community Process or JCP, established in 1995, is a formalized process which allows interested parties to be involved in the definition of future versions and features of the Java platform. ... Sun Microsystems, Inc. ... Free Java implementations are software projects that reimplement Suns Java technologies and are distributed under free software licences, thus making them free software / open source software. ... Java bytecode is the form of instructions that the Java virtual machine executes. ... // The syntax of the Java programming language is a set of rules that defines how a Java program is written and interpreted. ... A Java applet is an applet delivered in the form of Java bytecode. ... JavaServer Pages (JSP) is a Java technology that allows software developers to dynamically generate HTML, XML or other types of documents in response to a Web client request. ... Java Web Start, introduced in Java 2, allows provisioning applications over the Web by clicking a desktop icon or a link on a website. ... The Common Gateway Interface (CGI) is a standard protocol for interfacing external application software with an information server, commonly a web server. ... Simple Common Gateway Interface (SCGI) protocol is a replacement for the CGI protocol. ... FastCGI is a protocol for interfacing interactive programs with a web server. ... The Internet Service Application Programming Interface (ISAPI) is the API of Internet Information Services (IIS), Microsofts collection of Windows-based network services. ... The Netscape Server Application Programming Interface (NSAPI) is an application programming interface for extending server software, typically web server software. ... Apache JServ is implemented as two separate components, one written in C and the other in Java. ... The Web Server Gateway Interface defines a simple and universal interface between web servers and web applications or frameworks for the Python programming language. ... The Apache HTTP Server, commonly referred to simply as Apache, is a web server notable for playing a key role in the initial growth of the World Wide Web. ... mod_perl is an optional module for the Apache web server. ... For the PHP Cold War history project, see Parallel History Project. ... mod_python is an Apache HTTP Server module that integrates the Python programming language into the Apache server. ... mod_ruby is a embedded Ruby interpreter of the Apache web server to allow Ruby code executing natively and faster than other CGI methods. ...

Headline text


  Results from FactBites:
 
An Introduction to Java Servlet Programming (1869 words)
Servlets are server side components.These components can be run on any platform or any server due to the core java technology which is used to implement them.
The servlet processes the client request and sends the response back to the server/container, which is routed to the client [1].
To write a servlet specifically for the HTTP protocol, an HTTPServlet class that extends the GenericServlet class is used (Figure 4).
Java Servlet - Wikipedia, the free encyclopedia (566 words)
Servlets may be packaged in a WAR file as a Web application.
Often servlets are used in conjunction with JSPs in a pattern called "Model 2", which is a flavor of the model-view-controller pattern.
As of May 10, 2006, the current version of the servlet specification is 2.5.
  More results at FactBites »

 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your location
Your comments
Please enter the 5-letter protection code


Lesson Plans | Student Area | Student FAQ | Reviews | Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms.