tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <cmcclana...@mytownnet.com>
Subject Re: servlet confusion...
Date Mon, 20 Mar 2000 02:28:54 GMT
Ron Forrester wrote:

> I have from from JServ over to tomcat this afternoon.
>
> First, I really enjoyed the installation process, having suffered
> through JServ+gnujsp installations.
>
> One thing has me quite confused however -- all of the example servlets
> with tomcat are embedded in HTML files.

This was done only to let you look at the source code -- servlets must be
Java class files, or packaged in a JAR file, to be executed.

> I am used to seeing servlets
> in .class files. Is this no longer supported? I copied a
> blah.{java,class} file into the example servlets dir and it just
> treats it like a generic file.
>
> Do I need to wrap all my servlets in container/launcher HTML files
> like the examples are?
>

No.

Put your servlet classes in the WEB-INF/classes directory (or in a JAR file
in the WEB-INF/lib directory) of your web application.  These places are
automatically added to the class path for your app -- no additional
manipulation of the class path is required.  Set up the web application
deployment descriptor (WEB-INF/web.xml) as described in the Servlet 2.2
specification.


>
> Thanks.
> rjf&
>

Craig McClanahan



Mime
View raw message