Home Segments Top Top Previous Next

1038: Mainline

You learn how to define a servlet in Segment 1041. Once you have written a collection of servlets and have written or augmented a servlets.properties file, you need to know where to put them. Unfortunately, the place will depend on the servlet server that you happen to use. If you happen to use a servlet server supplied by Sun Microsystems, Inc., then the servlets.properties file belongs in a directory named WEB-INF, a subdirectory of the servlet server directory, and all your servlets belong in a directory named servlets, a subdirectory of the WEB-INF directory. If you have divided your servlets into packages, however, then servlets acts as though it were on your CLASSPATH, as described in Chapter 35, and your servlets belong in subdirectories of the servlets directory corresponding to your package names.

Of course, you can tell the servlet server to look in a place other than the default place for servlets; In general, however, you would be wise to run your servlet server with the default location, inasmuch as software developers tend to test software mostly with the defaults.

See the Software page at the end of this book for information on how to download a servlet server.