Wednesday, August 6, 2008

consider yourself to be an experienced

Whether you consider yourself to be an experienced Java developer or not, it's a safe bet that you've heard of Java Applets. Applets are little Java programs that run as part of a Web page. Since they're sort of 'mini-applications', they were dubbed 'applets'. Java Servlets got their name in a similar way.

Think of Servlets as highly efficient CGI programs written in Java. When a Servlet-capable Web server receives a request for a URL that corresponds to a Java Servlet, the server hands the request off to the Servlet for processing. The Servlet dynamically produces a response to the request (typically an HTML Web page) and sends it back to the requesting browser. If you think of Servlets in this context as 'mini-servers', their name makes perfect sense.

In this article, I'll take you through the basics of writing and deploying Java Servlets on your own Web server. I'll begin with the assumption that you're already equipped with a Servlet-capable Web server. While there are many offerings in this arena, the free combination of Apache and Tomcat is the most readily available. Most experienced Java developers prefer one of the slick, commercial solutions such as Caucho Resin, IBM WebSphere, or Allaire JRun (see a complete list); and while most of these are free for non-commercial use, the standard, "nitty gritty" methods supported by Tomcat are what we'll work with in this article. If you haven't already set up Apache and Tomcat, now would be a good time. See my JSP Quick-Start Guide for a helpful walkthrough, upon which the assumed configuration in this article is based.

No comments: