Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > media > main-release > by-pkgid > de0d3fe62b70b822f25ed709d9257ec5 > files > 82

jetty5-manual-5.1.12-1.0.7mdv2008.1.x86_64.rpm

SECTION: 200-General
TITLE: Servlets v Handlers
QUESTION: Should I use Servlets or HttpHandlers?

Jetty can be used as a HTTP Server, as a Servlet Container or both.  
<p>
If it is being used
as a standard servlet container, then servlets (or filters) should be used for your dynamic 
content.
Servlets may be directly configured in code or jetty.xml, however it is probably best to 
use a standard webapplication layout and a web.xml to configure servlets.

<p>

If Jetty is being used as an embedded HTTP server without servlet support, then
HttpHandler can be used. HttpHandlers are Jetty's own API for handling HTTP requests.
<p>
Only in rare circumstances should both servlets and HttpHandlers be used by a 
developer. 
The Jetty tutorial expands on the difference between Servlets and Handlers.