blob: b398768a2cb2691ceae5d3b6de14f10ff4975dc8 [file] [log] [blame]
syeshin30fe03d2005-09-01 14:44:04 +00001<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE html
lmandel49d6a1a2006-01-23 07:32:18 +00003 PUBLIC "-//IETF//DTD HTML 4.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4<html><head>
syeshin916fe232005-09-22 19:15:50 +00005<!-- /*******************************************************************************
lmandel49d6a1a2006-01-23 07:32:18 +00006 * Copyright (c) 2000, 2006 IBM Corporation and others.
syeshin916fe232005-09-22 19:15:50 +00007 * All rights reserved. This program and the accompanying materials
8 * are made available under the terms of the Eclipse Public License v1.0
9 * which accompanies this distribution, and is available at
10 * http://www.eclipse.org/legal/epl-v10.html
11 *
12 * Contributors:
13 * IBM Corporation - initial API and implementation
14 *******************************************************************************/ -->
lmandel49d6a1a2006-01-23 07:32:18 +000015<link rel="stylesheet" type="text/css" href="../../org.eclipse.wst.doc.user/common.css"/>
syeshin30fe03d2005-09-01 14:44:04 +000016<title>Servlets</title>
syeshin66078272005-09-20 16:53:38 +000017</head>
syeshin30fe03d2005-09-01 14:44:04 +000018<body id="cwservbn"><a name="cwservbn"><!-- --></a>
syeshin30fe03d2005-09-01 14:44:04 +000019<h1 class="topictitle1">Servlets</h1>
lmandel49d6a1a2006-01-23 07:32:18 +000020<div><p>Servlets are server-side Java&#8482; programs that use the <cite>Sun Microsystems Java Servlet
syeshin30fe03d2005-09-01 14:44:04 +000021API</cite> and its associated classes and methods, as defined in the <cite>Sun
syeshin30fe03d2005-09-01 14:44:04 +000022Microsystems Java Servlet 2.3 Specification</cite>. These Java programs
syeshin30fe03d2005-09-01 14:44:04 +000023extend the functionality of a Web server by generating dynamic content and
syeshin30fe03d2005-09-01 14:44:04 +000024responding to Web client requests. When a browser sends a request to the server,
syeshin30fe03d2005-09-01 14:44:04 +000025the server can send the request information to a servlet, so that the servlet
syeshin30fe03d2005-09-01 14:44:04 +000026can construct the response that is sent back to the browser.</p>
27<p>Just as applets run on a Web browser and extend the browser's capabilities,
lmandel8c0b2dc2006-04-05 02:49:25 +000028servlets run on a Java-enabled Web server and extend
lmandel49d6a1a2006-01-23 07:32:18 +000029the server's capabilities. Because of their flexibility and scalability, servlets
30are commonly used to enable businesses to connect databases to the Web.</p>
syeshin30fe03d2005-09-01 14:44:04 +000031<div class="p">Although a servlet can be a completely self-contained program, you can
syeshin30fe03d2005-09-01 14:44:04 +000032split application development into two portions: <ul><li>The business logic (content generation), which governs the relationship
syeshin30fe03d2005-09-01 14:44:04 +000033between input, processing, and output</li>
34<li>The presentation logic (content presentation, or graphic design rules),
syeshin30fe03d2005-09-01 14:44:04 +000035which determines how information is presented to the user</li>
36</ul>
37Using this paradigm, you may choose to have business logic handled by Java beans,
syeshin30fe03d2005-09-01 14:44:04 +000038the presentation logic handled by JavaServer Pages (JSP) or HTML files, and
lmandel49d6a1a2006-01-23 07:32:18 +000039the HTTP protocol handled by a servlet. <div class="note"><span class="notetitle">Note:</span> JSP files can be used to manage
syeshin30fe03d2005-09-01 14:44:04 +000040both the presentation and business logic for a Web application. JSP files
syeshin30fe03d2005-09-01 14:44:04 +000041use structured markup for presentation, and supply servlet model behavior
syeshin30fe03d2005-09-01 14:44:04 +000042at run time.</div>
43</div>
lmandel49d6a1a2006-01-23 07:32:18 +000044<p>You can develop, debug, and deploy servlets, set breakpoints within servlet
45objects, and step through code to make changes that are dynamically folded
46into the running servlet on a running server, without having to restart each
47time.</p>
syeshin30fe03d2005-09-01 14:44:04 +000048<p>For more information about servlets, refer to the <cite>Sun Microsystems Java Servlet
syeshin30fe03d2005-09-01 14:44:04 +0000492.3 Specification</cite> at <samp class="codeph">java.sun.com/products/servlet/download.html</samp>.</p>
50</div>
lmandel49d6a1a2006-01-23 07:32:18 +000051<div><div class="relconcepts"><strong>Related concepts</strong><br>
52<div><a href="ccwtover.html">Web application overview</a></div>
syeshin30fe03d2005-09-01 14:44:04 +000053</div>
lmandel49d6a1a2006-01-23 07:32:18 +000054<div class="reltasks"><strong>Related tasks</strong><br>
55<div><a href="twsrvwiz.html">Creating servlets</a></div>
56</div>
57</div>
58</body></html>