Monday, April 9, 2001 08:45 AM
A servlet is not intended to run on its own. Instead, it is designed to be run by a servlet container (e.g., servletrunner, Tomcat), which will invoke its init, service, doGet, and doPost methods as needed. The servlet container (not the servlet) has a "main" method which is invoked at start-up.
If you wanted, you could write a class which calls the servlet, but then you would need to follow the servlet API. Your class would thus need to create ServletRequest and ServletResponse objects to pass to the servlet on a call to its service method. Typically, however, you would want to either use one of the commercially available servlet containers, or to write something other than a servlet.