Depends on your servlet engine.  My allows me to register a JAR file when I
register an individual servlet (although I don't actually use this
feature).  If yours doesn't then the classpath is your only option.

The servlet 2.2 API has this new feature called a .WAR file.  This allow
you to package not just classes but HTML and anything else required to run
a servlet.  They allow you to create a self contained "Web Application"
that you simply drop into a directory and it automatically registers
itself.  None of the engines support 2.2 yet but look out for it in the
future.

If you are using JDK 1.2 then you might be able to use the extension
mechanism.  This allows you to plop a jar file in the extensions directory
and have it automatically register as an extension.  Which just means
in-effect that it becomes part of the classpath without having to modify
the classpath.

Usually I find that once I've stuck the jar files into the classpath I
don't have to fiddle too much.

We should talk more about this servlet stuff.  I've got a lot of knowledge
I can pass on in this area.  One package you may want to checkout is
www.freemarker.org this allows you to separate the html from the servlet.
Also, how do you manage to debug your servlets?  I have a package which may
help there (although it's a little flakey in spots).

Have fun!

-- Glen






Greg McPherson <[EMAIL PROTECTED]> on 11/10/99 14:41:25

Please respond to "A mailing list for discussion about Sun Microsystem's
      Java              Servlet API Technology."
      <[EMAIL PROTECTED]>

To:   [EMAIL PROTECTED]
cc:    (bcc: Glen Stampoultzis/ITD/MEL/Ansett/AU)
Subject:  Servlets vs JARs




Ok, a very basic question.
I've got a servlet working fine using .class files, but I'd like to package
the thing up into a single JAR (It's a multipurpose bit of code...  either
a
command line application, a Swing GUI app, or a servlet).  I dislike the
idea of having to hardwire paths into the System CLASSPATH, it's not the
most user friendly part of the Java framework.  Is this the only way to
make
a JAR servlet work, or am I really forced to stick with class files?

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html






_____________________________________________________________________
CAUTION - This message may contain privileged and confidential
information intended only for the use of the addressee named above.
If you are not the intended recipient of this message you are hereby
notified that any use, dissemination, distribution or reproduction
of this message is prohibited. If you have received this message in
error please notify Ansett Australia immediately. Any views expressed
in this message are those of the individual sender and may not
necessarily reflect the views of Ansett Australia.
_____________________________________________________________________

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to