tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rob S." <rsli...@home.com>
Subject RE: Thanks and a few more questions
Date Wed, 12 Jul 2000 05:48:01 GMT
Hi Lloyd,

> >> One other question. Can tomcat compile .java's on the fly (and cache
> >> them). Or must I compile them manually and place them in cgi-bin with
> >> some externsion that I can add to apache's config?
>
> > Do you mean "does tomcat compile java files located in a web app
> > automatically"?
>
> > If so, no you have to compile them and place them in tomcat's classpath
> > either as .class files or in a jar file.
>
> Ahh ok, then I have to put something in apache config to make tomcat run
> .jar's?

What's your goal?  For your JSPs to use class files/jars that you've
written?  Since it's probably something specific to your web application /
Context, you'll want it in under your docBase/WEB-INF/classes directory.

Actually, it's explained here in much more detail:

http://jakarta.apache.org/tomcat/jakarta-tomcat/src/doc/appdev/

By "run .jar's" I assume you mean "have access to".  If it's a jar you've
built, toss it in your docBase/WEB-INF/classes directory.  If it's a
third-party jar, like a JDBC driver, toss it in docBase/WEB-INF/lib.  That's
it.  Tomcat will load it for you when you reference it.

Example: I have a class - com.blah.blah.Loggah.  In a JSP that's in this
Context under docBase in my classes directory. In my JSP, I use:

<%@ page import="com.blah.*" %>

Then later on in the page:

<% Logger.logInfo("blah") %>

...and that's it.  You don't have to tell Tomcat anything to get it to use
your classes.  See the above link for more info as to what all is happening
here.

All good things, doing the bull dance.

Hope this helps!

- r


Mime
View raw message