You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by jon * <jo...@clearink.com> on 2000/05/04 00:33:08 UTC
A WAR issue
Ok...this WAR stuff is getting ugly. :-( The spec is very vague about quite
a few things. I wish I had started playing with this earlier...
<http://jakarta.apache.org/cvsweb/index.cgi/jakarta-tomcat/src/share/org/apa
che/tomcat/context/DefaultCMSetter.java?rev=1.30&content-type=text/vnd.viewc
vs-markup>
initURLs(Context context)
#1. It seems as though only ".jar" files in the WEB-INF/lib/ directory are
added to the classpath. Shouldn't it also look for ".zip" as well?
#2. I think that the WEB-INF/lib/ directory itself should be added to the
classpath. That way, for applications like WebMacro, it would be easily
possible to put the Webmacro.properties file (which it finds by looking in
the classpath) into the WEB-INF/lib/ directory and have things work out of
the box.
Comments?
-jon
--
Scarab -
Java Servlet Based - Open Source
Bug/Issue Tracking System
<http://scarab.tigris.org/>
Re: A WAR issue
Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
jon * wrote:
> on 5/3/2000 4:03 PM, Craig McClanahan <Cr...@eng.sun.com> wrote:
>
> > The spec only says "jar files", not zip files. Tomcat could certainly do zips
> > as well, but then the WAR files would not be portable.
>
> Ok...not a big deal. I thought that .zip and .jar were essentially the same
> thing though. I'm not sure what you mean by portable.
>
"Portable" as in "this web application will run on any 2.2-compliant servlet
container." If we made Tomcat load zips as well as jars from WEB-INF/lib, and a web
application depended on that, it would break as soon as that app was moved to a
different platform.
>
> > If you want stuff like this, you probably want to put your properties file in
> > WEB-INF/classes instead -- this directory as a whole is also added.
>
> Ok that is one solution, but what if you also want un-jarred files in the
> WEB-INF/lib directory?
>
If you really want to do that, you can -- for things like property files you can
load them with ServletContext.getResource() as we discussed earlier. However, you'd
be using that directory for something other than the conventional purpose, and are
likely to confuse people.
If you want Java classes or resources to be unpacked, put them in WEB-INF/classes
instead. That's what it is for.
> -jon
>
Craig McClanahan
CVS version of Ant
Posted by John Pappin <jo...@jmonkey.com>.
What is going on with the CVS distributions of Ant?
This is the output I get trying to build it:
D:\working\jakarta-ant>build
Buildfile: build.xml
Project base dir set to: D:\working\jakarta-ant
Executing Target: prepare
Created dir: D:\working\build\ant
Executing Target: check_for_optional_packages
Executing Target: compile
Created dir: D:\working\build\ant\classes
Compiling 51 source files to D:\working\build\ant\classes
D:\working\jakarta-ant\src\main\org\apache\tools\ant\ProjectHelper.java:64:
Pack
avax.xml.parsers not found in import.
import javax.xml.parsers.*;
^
1 error
BUILD FATAL ERROR: Compile failed, messages should have been provided.
D:\working\jakarta-ant>
Anyone know where this new XML class is?
- Brill Pappin
Re: A WAR issue
Posted by jon * <jo...@clearink.com>.
on 5/3/2000 4:03 PM, Craig McClanahan <Cr...@eng.sun.com> wrote:
> The spec only says "jar files", not zip files. Tomcat could certainly do zips
> as well, but then the WAR files would not be portable.
Ok...not a big deal. I thought that .zip and .jar were essentially the same
thing though. I'm not sure what you mean by portable.
> If you want stuff like this, you probably want to put your properties file in
> WEB-INF/classes instead -- this directory as a whole is also added.
Ok that is one solution, but what if you also want un-jarred files in the
WEB-INF/lib directory?
-jon
--
Scarab -
Java Servlet Based - Open Source
Bug/Issue Tracking System
<http://scarab.tigris.org/>
Re: A WAR issue
Posted by Craig McClanahan <Cr...@eng.sun.com>.
jon * wrote:
> Ok...this WAR stuff is getting ugly. :-( The spec is very vague about quite
> a few things. I wish I had started playing with this earlier...
>
> <http://jakarta.apache.org/cvsweb/index.cgi/jakarta-tomcat/src/share/org/apa
> che/tomcat/context/DefaultCMSetter.java?rev=1.30&content-type=text/vnd.viewc
> vs-markup>
>
> initURLs(Context context)
>
> #1. It seems as though only ".jar" files in the WEB-INF/lib/ directory are
> added to the classpath. Shouldn't it also look for ".zip" as well?
>
The spec only says "jar files", not zip files. Tomcat could certainly do zips
as well, but then the WAR files would not be portable.
>
> #2. I think that the WEB-INF/lib/ directory itself should be added to the
> classpath. That way, for applications like WebMacro, it would be easily
> possible to put the Webmacro.properties file (which it finds by looking in
> the classpath) into the WEB-INF/lib/ directory and have things work out of
> the box.
>
If you want stuff like this, you probably want to put your properties file in
WEB-INF/classes instead -- this directory as a whole is also added.
>
> Comments?
>
> -jon
>
Craig
RE: A WAR issue
Posted by John Pappin <jo...@jmonkey.com>.
Actually, I like it how it is... however, to make it more flexible how about
adding a config option to the web.xml so that additional paths can be added?
You could have different types, or rules for a single type that way...
Take hart, I'm actually finding that Tomcat is very good with its WAR files,
but I've had a bit of trouble with them on WebLogic.
- Brill Pappin
> -----Original Message-----
> From: jon * [mailto:jon@clearink.com]
> Sent: May 3, 2000 6:33 PM
> To: Jakarta Tomcat-Dev
> Subject: A WAR issue
>
>
> Ok...this WAR stuff is getting ugly. :-( The spec is very vague
> about quite
> a few things. I wish I had started playing with this earlier...
>
> <http://jakarta.apache.org/cvsweb/index.cgi/jakarta-tomcat/src/sha
re/org/apa
che/tomcat/context/DefaultCMSetter.java?rev=1.30&content-type=text/vnd.viewc
vs-markup>
initURLs(Context context)
#1. It seems as though only ".jar" files in the WEB-INF/lib/ directory are
added to the classpath. Shouldn't it also look for ".zip" as well?
#2. I think that the WEB-INF/lib/ directory itself should be added to the
classpath. That way, for applications like WebMacro, it would be easily
possible to put the Webmacro.properties file (which it finds by looking in
the classpath) into the WEB-INF/lib/ directory and have things work out of
the box.
Comments?
-jon
--
Scarab -
Java Servlet Based - Open Source
Bug/Issue Tracking System
<http://scarab.tigris.org/>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org