commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Cooper <mfncoo...@gmail.com>
Subject Re: [FileUpload] Very Basic Question
Date Sun, 19 Dec 2004 21:11:17 GMT
On Sun, 19 Dec 2004 15:25:34 -0500, Frank W. Zammetti
<fzlists@omnytex.com> wrote:
> FYI, you can also put it in common/lib or shared/lib (I'm not sure if
> there is any difference, I assume so, but I don't know what it is).
> This will allow all webapps running under that server instance to find
> and use the JAR.  Be careful though, you can run into versioning issues
> doing that (I personally prefer each webapp have it's own copy of any
> JAR it needs, except for those that come with the app server itself).

The difference between common and shared is that jars in the former
will also be picked up by Tomcat itself, while jars in the latter are
shared only across web apps. The full story (worthwhile reading) is
here:

http://jakarta.apache.org/tomcat/tomcat-5.0-doc/class-loader-howto.html

In general, I find it preferable to avoid using anything outside the
web app itself. In addition to the nasty versioning issues you
mention, making the war self-contained makes it easier to simply drop
it into another container without having to worry about whether the
necessary dependencies are there or not.

--
Martin Cooper


> --
> Frank W. Zammetti
> Founder and Chief Software Architect
> Omnytex Technologies
> http://www.omnytex.com
> 
> 
> Rhino wrote:
> > Thank you VERY much! It now seems to be working correctly.
> >
> > Between a new version of Tomcat, a new version of Sysdeo, a new version and
> > the fact that I could never quite get FileUpload to work in the old versions
> > of any of these tools, I was getting very confused. I wish I had asked this
> > exact question a year and a half ago when I first started working with
> > FileUpload ;-)
> >
> > Again, thanks Martin! I am really looking forward to getting this project
> > working now.
> >
> > Rhino
> >
> >
> > ----- Original Message -----
> > From: "Martin Cooper" <mfncooper@gmail.com>
> > To: "Jakarta Commons Users List" <commons-user@jakarta.apache.org>
> > Sent: Sunday, December 19, 2004 1:05 PM
> > Subject: Re: [FileUpload] Very Basic Question
> >
> >
> >
> >>On Sun, 19 Dec 2004 12:38:57 -0500, Rhino <rhino1@sympatico.ca> wrote:
> >>
> >>>Could someone kindly tell me where I should be putting the
> >>>commons-fileupload-1.0-jar when I deploy my Tomcat servlet to Tomcat?
> >
> > I've
> >
> >>>searched high and low through mailing lists and FileUpload docs and I
> >
> > can't
> >
> >>>find any mention of this.
> >>>
> >>>My servlet compiles fine but when I deploy it to Tomcat (5.0.28) Tomcat
> >>>can't find the jar so that it can do the uploading and I get this:
> >>
> >><snip/>
> >>
> >>>I think this is nature's way of telling me that I haven't got the
> >
> > FileUpload
> >
> >>>jar in the right place. Apparently, Tomcat can't use the copy of the jar
> >>>that is in server/lib; as I understand it, this directory is only for
> >>>uploads done by the server, not by the applications. I would have tried
> >
> > it
> >
> >>>in common/lib but I have specific instructions from Martin Cooper that
> >
> > say
> >
> >>>"keep the FileUpload jar within your own web app, and don't try to share
> >
> > it
> >
> >>>by putting it in common/lib".
> >>>
> >>>So where DO I put the jar??? I suppose the answer should be obvious
> >
> > since I
> >
> >>>can't find any evidence of anyone else ever asking it but it's eluding
> >
> > me.
> >
> >>The FileUpload jar file should go into WEB-INF/lib, inside your war
> >>file. This is the same place that all of your other jar files should
> >>go, and is the standard location for jar files in a web application.
> >>See the Servlet spec for more information.
> >>
> >>--
> >>Martin Cooper
> >>
> >>
> >>
> >>>Do I just drop the jar in the webapps/[MyAppName] folder? Won't that
> >
> > ensure
> >
> >>>that I have to put it back there manually every time I redeploy the
> >
> > servlet?
> >
> >>>Should I put the jar in the WAR file itself?
> >>>
> >>>Any guidance would be appreciated!
> >>>
> >>>Rhino
> >>>---
> >>>rhino1 AT sympatico DOT ca
> >>>"There are two ways of constructing a software design. One way is to
> >
> > make it
> >
> >>>so simple that there are obviously no deficiencies. And the other way is
> >
> > to
> >
> >>>make it so complicated that there are no obvious deficiencies." - C.A.R.
> >>>Hoare
> >>>
> >>>---------------------------------------------------------------------
> >>>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> >>>For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >>>
> >>>
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >>
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >
> >
> >
> >
> >
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message