tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Funk <funk...@joedog.org>
Subject Re: Accessing objects with any servlets, where the object is already pre-created
Date Tue, 07 Oct 2003 12:07:29 GMT
No. Via the Servlet Context javadocs ...
"There is one context per "web application" per Java Virtual Machine. (A "web 
application" is a collection of servlets and content installed under a 
specific subset of the server's URL namespace such as /catalog  and possibly 
installed via a .war file.)"

-Tim

Adam Hardy wrote:

> Another issue might be sharing the objects between servlets - I think 
> that is what the original poster meant. Doesn't each servlet have its 
> own servlet context?
> 
> On 10/07/2003 01:50 PM Peter Guyatt wrote:
> 
>> Hi there,
>>
>> I beleive that using the setAttribute adds the object to a hashtable.
>>
>> If when the hashtable reaches a certian limit (usually 75% of its total
>> size) it re-hashs which can be expensive and cause performance 
>> problems. The
>> solution is to ensure that the limit is never reached. Is there a way 
>> to set
>> the initial limit for the context?
>>
>> Pete
>>
>> -----Original Message-----
>> From: Tim Funk [mailto:funkman@joedog.org]
>> Sent: 07 October 2003 12:33
>> To: Tomcat Users List
>> Subject: Re: Accessing objects with any servlets, where the object is
>> already pre-created
>>
>>
>> I can't see why there would be a difference.
>>
>> -Tim
>>
>> Vidar Langberget wrote:
>>
>>
>>> Have you noticed any performance problems with storing large amounts of
>>
>>
>> data
>>
>>> in the servlet context?
>>>
>>> I'm developing a cache for my webapp, and I can't decide if I want to 
>>> use
>>
>>
>> a
>>
>>> static class or store cache instances in the servlet context.
>>>
>>>
>>> Vidar
>>>
>>> ----- Original Message -----
>>> From: "Tim Funk" <funkman@joedog.org>
>>>
>>>
>>>> My preference is to store the data into the servlet context (using
>>>> setAttribute). Then no static variables are needed.
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
>>
> 


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


Mime
View raw message