How to use classes from another webapp/context?

2003-09-05 Thread Ulrich Mayring
Hello,

I know that Tomcat has seperate classloaders for each webapp, but what I 
would like to do is have JSPs in one webapp and the classes they use in 
another. I tried enabling the crossContext feature for the relevant 
contexts, but that didn't work, the classes weren't found.

Background: we have editors, who write and deploy JSP files, and 
programmers, who write and deploy classes used by JSP files. I would 
like to have the editors manage their webapps with the JSP files via the 
HTML manager and the programmers to do the same for their webapps.

I know that I could put the classes under the shared directory, but then 
they would not be in a webapp anymore and thus management via the HTML 
manager would not work anymore. Tomcat would need to be restarted on 
every change.

I could also have the programmers give JAR files to the editors and have 
the editors deploy them with their webapps, but then the classes would 
be duplicated across many webapps and also I don't want the editors 
handling JAR files.

Is there any solution?

Thanks in advance for any pointers,

Ulrich



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


Re: How to use classes from another webapp/context?

2003-09-05 Thread Pradeep Gummi
Hi Ulrich,
I think you should get them working by placing the classes in the 
CATALINA_HOME/common/classes folder or the jars in the lib folder. This 
would share the classes in all web apps. There you would be giving the 
information of the catalina and system class loaders. 

grant codeBase "file:${catalina.home}/common/-" {
  permission java.security.AllPermission;
};
I am not sure if this is what you want. Actually I am trying to use 
classes from outside catalina.home and am trying to figure out if that 
is practically possible. Please update me if you have any solutions

thanks
pradeep 

- Original Message -
From: Ulrich Mayring <[EMAIL PROTECTED]>
Date: Friday, September 5, 2003 4:19 am
Subject: How to use classes from another webapp/context?

> Hello,
> 
> I know that Tomcat has seperate classloaders for each webapp, but 
> what I 
> would like to do is have JSPs in one webapp and the classes they 
> use in 
> another. I tried enabling the crossContext feature for the 
> relevant 
> contexts, but that didn't work, the classes weren't found.
> 
> Background: we have editors, who write and deploy JSP files, and 
> programmers, who write and deploy classes used by JSP files. I 
> would 
> like to have the editors manage their webapps with the JSP files 
> via the 
> HTML manager and the programmers to do the same for their webapps.
> 
> I know that I could put the classes under the shared directory, 
> but then 
> they would not be in a webapp anymore and thus management via the 
> HTML 
> manager would not work anymore. Tomcat would need to be restarted 
> on 
> every change.
> 
> I could also have the programmers give JAR files to the editors 
> and have 
> the editors deploy them with their webapps, but then the classes 
> would 
> be duplicated across many webapps and also I don't want the 
> editors 
> handling JAR files.
> 
> Is there any solution?
> 
> Thanks in advance for any pointers,
> 
> 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]



Re: How to use classes from another webapp/context?

2003-09-05 Thread Ulrich Mayring
Pradeep Gummi wrote:
Hi Ulrich,
I think you should get them working by placing the classes in the 
CATALINA_HOME/common/classes folder or the jars in the lib folder. This 
would share the classes in all web apps. There you would be giving the 
information of the catalina and system class loaders. 
I put the classes in CATALINA_HOME/shared/lib and 
CATALINA_HOME/shared/classes, which is where the Tomcat docs suggest I 
should put classes to share between all webapps.

However, I cannot update the classes now without restarting Tomcat, 
therefore I would like to have the classes in their own webapps, so they 
could be selectively deployed and undeployed.

Ulrich



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


Re: How to use classes from another webapp/context?

2003-09-05 Thread Christopher Williams
Easiest method:

Put JSPs in WAR and stick in webapps
Put classes in JAR and stick in common\lib



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



Re: How to use classes from another webapp/context?

2003-09-08 Thread Ulrich Mayring
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]


Re: How to use classes from another webapp/context?

2003-09-08 Thread Christopher Williams
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]



Re: How to use classes from another webapp/context?

2003-09-08 Thread Ulrich Mayring
Christopher Williams wrote:
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.
Yep, but then I can't deploy/undeploy the two WARs seperately. We have 
developers, who write classes, and they want to manage their WAR, and we 
have people, who write JSP files, and they want to manage their own WAR. 
But it seems they can't work together in the way I imagined.

Thank you very much for your help,

Ulrich



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


Re: How to use classes from another webapp/context?

2003-09-08 Thread Marco Tedone
Well, usually a WAR is a composite collection of JSPs, classes, deployment
descriptor, third-party jars and so on. If you have people who write
classes, they can create a jar, not a war, and people who create JSP can
just place them in the correct location. A good build project could then
merge the classes, the JSPs and whatever needed in a single, composite, war
file. Need to change a behaviour? Modify the class and redeploy the
application. Need to change layout? Change the JSP and copy/redeploy to the
correct location (Additionally restart the server :)

My 2 cents,

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


> Christopher Williams wrote:
> >
> > 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.
>
> Yep, but then I can't deploy/undeploy the two WARs seperately. We have
> developers, who write classes, and they want to manage their WAR, and we
> have people, who write JSP files, and they want to manage their own WAR.
> But it seems they can't work together in the way I imagined.
>
> Thank you very much for your help,
>
> 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]