blob: a471e7839d83d42f12dd4ada6b3eef8fae39bc43 [file] [log] [blame]
kprice9c922d82006-08-30 22:07:19 +00001<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
2<html lang="en-us" xml:lang="en-us">
4<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
kpricea99d2212008-04-23 22:51:09 +00005<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" />
6<meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" />
kprice9c922d82006-08-30 22:07:19 +00007<meta content="public" name="security" />
8<meta content="index,follow" name="Robots" />
9<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))' />
10<meta content="concept" name="DC.Type" />
11<meta name="DC.Title" content="Servlets" />
kpricea99d2212008-04-23 22:51:09 +000012<meta content="servlets, overview, Web servers, generating dynamic content" name="DC.subject" />
13<meta content="servlets, overview, Web servers, generating dynamic content" name="keywords" />
kprice96ee3b52008-05-15 00:05:07 +000014<meta scheme="URI" name="DC.Relation" content="../topics/cwlistbn.html" />
15<meta scheme="URI" name="DC.Relation" content="../topics/cwfiltbn.html" />
kpricea5ebfde2008-04-23 22:59:40 +000016<meta scheme="URI" name="DC.Relation" content="../topics/ccwtover.html" />
17<meta scheme="URI" name="DC.Relation" content="../topics/twsrvwiz.html" />
kprice96ee3b52008-05-15 00:05:07 +000018<meta scheme="URI" name="DC.Relation" content="../topics/twlstwiz.html" />
19<meta scheme="URI" name="DC.Relation" content="../topics/twfltwiz.html" />
kprice9c922d82006-08-30 22:07:19 +000020<meta content="XHTML" name="DC.Format" />
21<meta content="cwservbn" name="DC.Identifier" />
22<meta content="en-us" name="DC.Language" />
23<link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" />
syeshin30fe03d2005-09-01 14:44:04 +000024<title>Servlets</title>
syeshin66078272005-09-20 16:53:38 +000025</head>
syeshin30fe03d2005-09-01 14:44:04 +000026<body id="cwservbn"><a name="cwservbn"><!-- --></a>
kprice9c922d82006-08-30 22:07:19 +000027
syeshin30fe03d2005-09-01 14:44:04 +000029<h1 class="topictitle1">Servlets</h1>
kprice9c922d82006-08-30 22:07:19 +000030
33<p>Servlets are server-side Java™ programs that use the <cite>Sun Microsystems Java Servlet
syeshin30fe03d2005-09-01 14:44:04 +000034API</cite> and its associated classes and methods, as defined in the <cite>Sun
syeshin30fe03d2005-09-01 14:44:04 +000035Microsystems Java Servlet 2.3 Specification</cite>. These Java programs
syeshin30fe03d2005-09-01 14:44:04 +000036extend the functionality of a Web server by generating dynamic content and
syeshin30fe03d2005-09-01 14:44:04 +000037responding to Web client requests. When a browser sends a request to the server,
syeshin30fe03d2005-09-01 14:44:04 +000038the server can send the request information to a servlet, so that the servlet
syeshin30fe03d2005-09-01 14:44:04 +000039can construct the response that is sent back to the browser.</p>
kprice9c922d82006-08-30 22:07:19 +000040
syeshin30fe03d2005-09-01 14:44:04 +000041<p>Just as applets run on a Web browser and extend the browser's capabilities,
kprice9c922d82006-08-30 22:07:19 +000042servlets run on a Java-enabled Web server and extend the server's capabilities.
43Because of their flexibility and scalability, servlets are commonly used to
44enable businesses to connect databases to the Web.</p>
syeshin30fe03d2005-09-01 14:44:04 +000046<div class="p">Although a servlet can be a completely self-contained program, you can
kprice9c922d82006-08-30 22:07:19 +000047split application development into two portions: <ul>
48<li>The business logic (content generation), which governs the relationship
syeshin30fe03d2005-09-01 14:44:04 +000049between input, processing, and output</li>
kprice9c922d82006-08-30 22:07:19 +000050
syeshin30fe03d2005-09-01 14:44:04 +000051<li>The presentation logic (content presentation, or graphic design rules),
syeshin30fe03d2005-09-01 14:44:04 +000052which determines how information is presented to the user</li>
kprice9c922d82006-08-30 22:07:19 +000053
syeshin30fe03d2005-09-01 14:44:04 +000054</ul>
55Using this paradigm, you may choose to have business logic handled by Java beans,
syeshin30fe03d2005-09-01 14:44:04 +000056the presentation logic handled by JavaServer Pages (JSP) or HTML files, and
kprice96ee3b52008-05-15 00:05:07 +000057the HTTP protocol handled by a servlet.</div>
59<div class="note"><span class="notetitle">Note:</span> JSP files can be used to manage both the presentation and business logic
60for a Web application. JSP files use structured markup for presentation, and
61supply servlet model behavior at run time.</div>
kprice9c922d82006-08-30 22:07:19 +000062
lmandel49d6a1a2006-01-23 07:32:18 +000063<p>You can develop, debug, and deploy servlets, set breakpoints within servlet
64objects, and step through code to make changes that are dynamically folded
65into the running servlet on a running server, without having to restart each
kprice9c922d82006-08-30 22:07:19 +000067
syeshin30fe03d2005-09-01 14:44:04 +000068<p>For more information about servlets, refer to the <cite>Sun Microsystems Java Servlet
syeshin30fe03d2005-09-01 14:44:04 +0000692.3 Specification</cite> at <samp class="codeph"></samp>.</p>
kprice9c922d82006-08-30 22:07:19 +000070
syeshin30fe03d2005-09-01 14:44:04 +000071</div>
kprice9c922d82006-08-30 22:07:19 +000072
kpricea5ebfde2008-04-23 22:59:40 +000073<div><div class="relconcepts"><strong>Related concepts</strong><br />
kprice96ee3b52008-05-15 00:05:07 +000074<div><a href="../topics/cwlistbn.html" title="">Listeners</a></div>
75<div><a href="../topics/cwfiltbn.html" title="">Listeners</a></div>
kpricea5ebfde2008-04-23 22:59:40 +000076<div><a href="../topics/ccwtover.html" title="">Web application overview</a></div>
78<div class="reltasks"><strong>Related tasks</strong><br />
kprice96ee3b52008-05-15 00:05:07 +000079<div><a href="../topics/twsrvwiz.html">Creating Servlets</a></div>
80<div><a href="../topics/twlstwiz.html">Creating Listeners</a></div>
81<div><a href="../topics/twfltwiz.html">Creating Filters</a></div>
kpricea5ebfde2008-04-23 22:59:40 +000082</div>
kprice9c922d82006-08-30 22:07:19 +000084