blob: 41b5813c3b2e9e41c0eb37e598cba3a0b72d0e9d [file] [log] [blame]
kprice9c922d82006-08-30 22:07:19 +00001<?xml version="1.0" encoding="utf-8"?>
kprice96ee3b52008-05-15 00:05:07 +00002<!--Arbortext, Inc., 1988-2006, v.4002-->
kprice9c922d82006-08-30 22:07:19 +00003<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"
4 "concept.dtd">
5<concept id="cwservbn" xml:lang="en-us">
kprice96ee3b52008-05-15 00:05:07 +00008<keywords><indexterm>servlets<indexterm>overview</indexterm></indexterm><indexterm>Web
9servers<indexterm>generating dynamic content</indexterm></indexterm></keywords>
kprice9c922d82006-08-30 22:07:19 +000010</metadata></prolog>
12<p>Servlets are server-side <tm tmclass="special" tmowner="Sun Microsystems, Inc."
13tmtype="tm" trademark="Java">Java</tm> programs that use the <cite>Sun Microsystems <tm
14tmclass="special" tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> Servlet
15API</cite> and its associated classes and methods, as defined in the <cite>Sun
16Microsystems <tm tmclass="special" tmowner="Sun Microsystems, Inc." tmtype="tm"
17trademark="Java">Java</tm> Servlet 2.3 Specification</cite>. These <tm tmclass="special"
18tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> programs
19extend the functionality of a Web server by generating dynamic content and
20responding to Web client requests. When a browser sends a request to the server,
21the server can send the request information to a servlet, so that the servlet
22can construct the response that is sent back to the browser.</p>
23<p>Just as applets run on a Web browser and extend the browser's capabilities,
24servlets run on a Java-enabled Web server and extend the server's capabilities.
25Because of their flexibility and scalability, servlets are commonly used to
26enable businesses to connect databases to the Web.</p>
27<p>Although a servlet can be a completely self-contained program, you can
28split application development into two portions: <ul>
29<li>The business logic (content generation), which governs the relationship
30between input, processing, and output</li>
31<li>The presentation logic (content presentation, or graphic design rules),
32which determines how information is presented to the user</li>
33</ul>Using this paradigm, you may choose to have business logic handled by <tm
34tmclass="special" tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> beans,
35the presentation logic handled by JavaServer Pages (JSP) or HTML files, and
kprice96ee3b52008-05-15 00:05:07 +000036the HTTP protocol handled by a servlet.</p>
37<note>JSP files can be used to manage both the presentation and business logic
38for a Web application. JSP files use structured markup for presentation, and
39supply servlet model behavior at run time.</note>
kprice9c922d82006-08-30 22:07:19 +000040<p>You can develop, debug, and deploy servlets, set breakpoints within servlet
41objects, and step through code to make changes that are dynamically folded
42into the running servlet on a running server, without having to restart each
44<p>For more information about servlets, refer to the <cite>Sun Microsystems <tm
45tmclass="special" tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> Servlet
462.3 Specification</cite> at <codeph></codeph>.</p>