blob: fb05e747b3703f2d138a33bd55b2d78692f9e587 [file] [log] [blame]
<?xml version="1.0" encoding="utf-8"?>
<!--Arbortext, Inc., 1988-2005, v.4002-->
<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN"
"concept.dtd">
<concept id="cwservbn" xml:lang="en-us">
<title>Servlets</title>
<prolog><metadata>
<keywords><indexterm>servlets<indexterm>overview</indexterm></indexterm>
<indexterm>Web servers<indexterm>generating dynamic content</indexterm></indexterm>
</keywords>
</metadata></prolog>
<conbody>
<p>Servlets are server-side <tm tmclass="special" tmowner="Sun Microsystems, Inc."
tmtype="tm" trademark="Java">Java</tm> programs that use the <cite>Sun Microsystems <tm
tmclass="special" tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> Servlet
API</cite> and its associated classes and methods, as defined in the <cite>Sun
Microsystems <tm tmclass="special" tmowner="Sun Microsystems, Inc." tmtype="tm"
trademark="Java">Java</tm> Servlet 2.3 Specification</cite>. These <tm tmclass="special"
tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> 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>
<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>
</ul>Using this paradigm, you may choose to have business logic handled by <tm
tmclass="special" tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> beans,
the presentation logic handled by JavaServer Pages (JSP) or HTML files, and
the HTTP protocol handled by a servlet. <note>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.</note></p>
<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
time.</p>
<p>For more information about servlets, refer to the <cite>Sun Microsystems <tm
tmclass="special" tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> Servlet
2.3 Specification</cite> at <codeph>java.sun.com/products/servlet/download.html</codeph>.</p>
</conbody>
</concept>