Let's say you have a web app and it's stored in my_app1.war.  Then you have
a second web app stored in my_app2.war and you want to use some really neat
classes defined in my_app1.war.  So you add my_app1.war to your second
application's classpath and stick "import com.me.my_stuff.really_neat_class"
in one of your source files.  Your compiler will complain that it can't find
"really_neat_class" because it does not have the path com/me/my_stuff, it's
in WEB-INF/classes/com/me/my_stuff instead.  Bummer.

Unfortunately, you do need to move classes common to multiple web apps into
library files.  You don't have to put the library files into common\lib,
however.  You can put the JARs in WEB-INF/lib inside your WAR file.  Never
done it myself, but it's supposed to work.

----- Original Message ----- 
From: "Ulrich Mayring" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, September 08, 2003 8:53 AM
Subject: Re: How to use classes from another webapp/context?


> Christopher Williams wrote:
> > Easiest method:
> >
> > Put JSPs in WAR and stick in webapps
> > Put classes in JAR and stick in common\lib
>
> I'd rather use a more complicated method, if that would allow me to put
> my classes in WARs as well :)
>
> Ulrich
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to