You are correct. that's what I get for trying to remember stuff.

Alias is on the host element. Pointing different URLs to the same host.

So you are using one URL with several paths. And are wanting the apps to be able to share info.

Two ways one might do this:

Use a database or outside resource.

Or

There is a setting to allow crossContext on the context element. I haven't used this but one might be able to do a call for the other context and set/get variables.

A search of the archives might find something on this.

As for your conclusion you are correct IF:

Quote from sun site.
http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/ServletContext.html

"In the case of a web application marked "distributed" in its deployment descriptor, there will be one context instance for each virtual machine. In this situation, the context cannot be used as a location to share global information (because the information won't be truly global). Use an external resource like a database instead."

So it will depend.


Doug


----- Original Message ----- From: "Ethan Herdrick (ReAtlas)" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[email protected]>
Sent: Thursday, January 27, 2005 11:15 PM
Subject: RE: Make Tomcat use one JVM for JSPs accessed from multiple URL paths



Hmm.  I guess I jumped to a conclusion.

Here's my situation: I've been running a web app for a while now that has
multiple contexts that use the same docBase. What I have found is that the
values of the static fields of my classes are not shared across contexts. I
need to make all my contexts share these static fields.


I had asssumed that I was dealing with a different JVM per context, but
simply having a different classloader per context would also cause this. So
I shouldn't have said anything about JVMs.


So I guess what I should ask is, how do I share static fields across Tomcat
contexts? An alternate way to solve this would be to use just one context
and somehow cause requests to multiple directories to resolve to a single
directory. Doug - I think this is what you are suggesting, but I was under
the impression that the "alias" is for hosts. I'll look into it now.


Thanks in advance!

Ethan

Parsons Technical Services  <[EMAIL PROTECTED]> to Tomcat
 Show options  7:34pm (32 minutes ago)

I think he may be looking for the alias attribute in the context.
Different
URLs served by the same app.

Give an example and we can probably give you an answer.

Doug

From: Ethan Herdrick (ReAtlas) [mailto:[EMAIL PROTECTED]
Subject: Make Tomcat use one JVM for JSPs accessed from multiple URL paths


I can create two different contexts that use the same docBase, but
unfortunately each context will have its own JVM.

??? I think there's a little confusion here - there's only one JVM per Tomcat execution, regardless of the number of contexts deployed within a Tomcat.

What are you really trying to do?

- Chuck

THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you received
this in error, please contact the sender and delete the e-mail and its
attachments from all computers.


- Show quoted text -

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



 ReplyForwardInvite Charles R to Gmail





---------------------------------------------------------------------
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