While similar to a Java applet, a Java servlet runs on the server
instead of the client side. Increasingly popular as an alternative to
CGI programs, a Java servlet can stay in the browser's memory to
fulfill multiple requests - unlike a CGI that must be restarted with
each new operation and can only fulfill one request at a time.
JavaServer Pages. A server-side technology, JavaServer pages are an
extension to the Java servlet technology that was developed by Sun.
JSPs have dynamic scripting capability that works in tandem with HTML
code, separating the page logic from the static elements -- the actual
design and display of the page. Embedded in the HTML page, the Java
source code and its extensions help make the HTML more functional,
being used in dynamic database queries, for example. JSPs are not
restricted to any specific platform or server.