syeshin | 30fe03d | 2005-09-01 14:44:04 +0000 | [diff] [blame] | 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | <!DOCTYPE html |
lmandel | 49d6a1a | 2006-01-23 07:32:18 +0000 | [diff] [blame] | 3 | PUBLIC "-//IETF//DTD HTML 4.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 4 | <html><head> |
syeshin | 916fe23 | 2005-09-22 19:15:50 +0000 | [diff] [blame] | 5 | <!-- /******************************************************************************* |
lmandel | 49d6a1a | 2006-01-23 07:32:18 +0000 | [diff] [blame] | 6 | * Copyright (c) 2000, 2006 IBM Corporation and others. |
syeshin | 916fe23 | 2005-09-22 19:15:50 +0000 | [diff] [blame] | 7 | * 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 | *******************************************************************************/ --> |
lmandel | 49d6a1a | 2006-01-23 07:32:18 +0000 | [diff] [blame] | 15 | <link rel="stylesheet" type="text/css" href="../../org.eclipse.wst.doc.user/common.css"/> |
syeshin | 30fe03d | 2005-09-01 14:44:04 +0000 | [diff] [blame] | 16 | <title>Servlets</title> |
syeshin | 6607827 | 2005-09-20 16:53:38 +0000 | [diff] [blame] | 17 | </head> |
syeshin | 30fe03d | 2005-09-01 14:44:04 +0000 | [diff] [blame] | 18 | <body id="cwservbn"><a name="cwservbn"><!-- --></a> |
syeshin | 30fe03d | 2005-09-01 14:44:04 +0000 | [diff] [blame] | 19 | <h1 class="topictitle1">Servlets</h1> |
lmandel | 49d6a1a | 2006-01-23 07:32:18 +0000 | [diff] [blame] | 20 | <div><p>Servlets are server-side Java™ programs that use the <cite>Sun Microsystems Java Servlet |
syeshin | 30fe03d | 2005-09-01 14:44:04 +0000 | [diff] [blame] | 21 | API</cite> and its associated classes and methods, as defined in the <cite>Sun |
syeshin | 30fe03d | 2005-09-01 14:44:04 +0000 | [diff] [blame] | 22 | Microsystems Java Servlet 2.3 Specification</cite>. These Java programs |
syeshin | 30fe03d | 2005-09-01 14:44:04 +0000 | [diff] [blame] | 23 | extend the functionality of a Web server by generating dynamic content and |
syeshin | 30fe03d | 2005-09-01 14:44:04 +0000 | [diff] [blame] | 24 | responding to Web client requests. When a browser sends a request to the server, |
syeshin | 30fe03d | 2005-09-01 14:44:04 +0000 | [diff] [blame] | 25 | the server can send the request information to a servlet, so that the servlet |
syeshin | 30fe03d | 2005-09-01 14:44:04 +0000 | [diff] [blame] | 26 | can 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, |
lmandel | 8c0b2dc | 2006-04-05 02:49:25 +0000 | [diff] [blame^] | 28 | servlets run on a Java-enabled Web server and extend |
lmandel | 49d6a1a | 2006-01-23 07:32:18 +0000 | [diff] [blame] | 29 | the server's capabilities. Because of their flexibility and scalability, servlets |
| 30 | are commonly used to enable businesses to connect databases to the Web.</p> |
syeshin | 30fe03d | 2005-09-01 14:44:04 +0000 | [diff] [blame] | 31 | <div class="p">Although a servlet can be a completely self-contained program, you can |
syeshin | 30fe03d | 2005-09-01 14:44:04 +0000 | [diff] [blame] | 32 | split application development into two portions: <ul><li>The business logic (content generation), which governs the relationship |
syeshin | 30fe03d | 2005-09-01 14:44:04 +0000 | [diff] [blame] | 33 | between input, processing, and output</li> |
| 34 | <li>The presentation logic (content presentation, or graphic design rules), |
syeshin | 30fe03d | 2005-09-01 14:44:04 +0000 | [diff] [blame] | 35 | which determines how information is presented to the user</li> |
| 36 | </ul> |
| 37 | Using this paradigm, you may choose to have business logic handled by Java beans, |
syeshin | 30fe03d | 2005-09-01 14:44:04 +0000 | [diff] [blame] | 38 | the presentation logic handled by JavaServer Pages (JSP) or HTML files, and |
lmandel | 49d6a1a | 2006-01-23 07:32:18 +0000 | [diff] [blame] | 39 | the HTTP protocol handled by a servlet. <div class="note"><span class="notetitle">Note:</span> JSP files can be used to manage |
syeshin | 30fe03d | 2005-09-01 14:44:04 +0000 | [diff] [blame] | 40 | both the presentation and business logic for a Web application. JSP files |
syeshin | 30fe03d | 2005-09-01 14:44:04 +0000 | [diff] [blame] | 41 | use structured markup for presentation, and supply servlet model behavior |
syeshin | 30fe03d | 2005-09-01 14:44:04 +0000 | [diff] [blame] | 42 | at run time.</div> |
| 43 | </div> |
lmandel | 49d6a1a | 2006-01-23 07:32:18 +0000 | [diff] [blame] | 44 | <p>You can develop, debug, and deploy servlets, set breakpoints within servlet |
| 45 | objects, and step through code to make changes that are dynamically folded |
| 46 | into the running servlet on a running server, without having to restart each |
| 47 | time.</p> |
syeshin | 30fe03d | 2005-09-01 14:44:04 +0000 | [diff] [blame] | 48 | <p>For more information about servlets, refer to the <cite>Sun Microsystems Java Servlet |
syeshin | 30fe03d | 2005-09-01 14:44:04 +0000 | [diff] [blame] | 49 | 2.3 Specification</cite> at <samp class="codeph">java.sun.com/products/servlet/download.html</samp>.</p> |
| 50 | </div> |
lmandel | 49d6a1a | 2006-01-23 07:32:18 +0000 | [diff] [blame] | 51 | <div><div class="relconcepts"><strong>Related concepts</strong><br> |
| 52 | <div><a href="ccwtover.html">Web application overview</a></div> |
syeshin | 30fe03d | 2005-09-01 14:44:04 +0000 | [diff] [blame] | 53 | </div> |
lmandel | 49d6a1a | 2006-01-23 07:32:18 +0000 | [diff] [blame] | 54 | <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> |