blob: a471e7839d83d42f12dd4ada6b3eef8fae39bc43 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html lang="en-us" xml:lang="en-us">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at Contributors: IBM Corporation - initial API and implementation" />
<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
<meta content="public" name="security" />
<meta content="index,follow" name="Robots" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "" l gen true r (n 0 s 0 v 0 l 0) "" l gen true r (SS~~000 1))' />
<meta content="concept" name="DC.Type" />
<meta name="DC.Title" content="Servlets" />
<meta content="servlets, overview, Web servers, generating dynamic content" name="DC.subject" />
<meta content="servlets, overview, Web servers, generating dynamic content" name="keywords" />
<meta scheme="URI" name="DC.Relation" content="../topics/cwlistbn.html" />
<meta scheme="URI" name="DC.Relation" content="../topics/cwfiltbn.html" />
<meta scheme="URI" name="DC.Relation" content="../topics/ccwtover.html" />
<meta scheme="URI" name="DC.Relation" content="../topics/twsrvwiz.html" />
<meta scheme="URI" name="DC.Relation" content="../topics/twlstwiz.html" />
<meta scheme="URI" name="DC.Relation" content="../topics/twfltwiz.html" />
<meta content="XHTML" name="DC.Format" />
<meta content="cwservbn" name="DC.Identifier" />
<meta content="en-us" name="DC.Language" />
<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
<body id="cwservbn"><a name="cwservbn"><!-- --></a>
<h1 class="topictitle1">Servlets</h1>
<p>Servlets are server-side Java™ programs that use the <cite>Sun Microsystems Java Servlet
API</cite> and its associated classes and methods, as defined in the <cite>Sun
Microsystems Java Servlet 2.3 Specification</cite>. These Java programs
extend the functionality of a Web server by generating dynamic content and
responding to Web client requests. When a browser sends a request to the server,
the server can send the request information to a servlet, so that the servlet
can construct the response that is sent back to the browser.</p>
<p>Just as applets run on a Web browser and extend the browser's capabilities,
servlets run on a Java-enabled Web server and extend the server's capabilities.
Because of their flexibility and scalability, servlets are commonly used to
enable businesses to connect databases to the Web.</p>
<div class="p">Although a servlet can be a completely self-contained program, you can
split application development into two portions: <ul>
<li>The business logic (content generation), which governs the relationship
between input, processing, and output</li>
<li>The presentation logic (content presentation, or graphic design rules),
which determines how information is presented to the user</li>
Using this paradigm, you may choose to have business logic handled by Java beans,
the presentation logic handled by JavaServer Pages (JSP) or HTML files, and
the HTTP protocol handled by a servlet.</div>
<div class="note"><span class="notetitle">Note:</span> JSP files can be used to manage both the presentation and business logic
for a Web application. JSP files use structured markup for presentation, and
supply servlet model behavior at run time.</div>
<p>You can develop, debug, and deploy servlets, set breakpoints within servlet
objects, and step through code to make changes that are dynamically folded
into the running servlet on a running server, without having to restart each
<p>For more information about servlets, refer to the <cite>Sun Microsystems Java Servlet
2.3 Specification</cite> at <samp class="codeph"></samp>.</p>
<div><div class="relconcepts"><strong>Related concepts</strong><br />
<div><a href="../topics/cwlistbn.html" title="">Listeners</a></div>
<div><a href="../topics/cwfiltbn.html" title="">Listeners</a></div>
<div><a href="../topics/ccwtover.html" title="">Web application overview</a></div>
<div class="reltasks"><strong>Related tasks</strong><br />
<div><a href="../topics/twsrvwiz.html">Creating Servlets</a></div>
<div><a href="../topics/twlstwiz.html">Creating Listeners</a></div>
<div><a href="../topics/twfltwiz.html">Creating Filters</a></div>