Tomcat 3.x is the reference implementation of Sun's Java Server Pages 1.1 and the Java Servlet 2.2 Specifications. Tomcat is a Servlet container which means that Java Servlets can be used within it to enable programmers to use the Servlet in such things as web pages. Whereas a JSP web page has both HTML and Java JSP code within the same document, a Servlet is a block of code that can be reused. These can then be compiled once and distributed to run on any standards compliant Servlet Container. A Servlet can be called directly to return HTML markup to a browser, but it is more usual that a JSP page uses the abilities of the Servlet (By calling it methods) and returns a custom representation of the returned data.
Servlets can do much more than return useful information for web pages, however. For example, it is possible to create a Servlet that listens for remote connections from an applet, say, and sends live stock information to the client application. In this manner a Servlet can be much more useful than a JSP/ASP page or other usual web server extension. This technology allows programmers to develop platform independant extensions that can be integrated simply with an existing web server.
A JSP page is quite similar to its Microsoft ASP counterpart in that it can produce dynamic web pages. There are added benefits to JSP pages over those of ASP pages in that a JSP page benefits from the features of the Java language. The most inportant features being portability, easy integration of extensions (Either through JAR files or Servlets) as well as Java's language robustness which prevent many niggly bugs associated with Visual Basic development.