tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Echerer <m...@tngtech.com>
Subject Re: Servlet inter-communication
Date Sat, 06 May 2006 06:24:56 GMT
Samuli Elomaa wrote:
> Hi,
> Is there any otherway for two servlets in same tomcat to communicate 
> together except by http requests? Eg. could two servlets use somekind 
> of shared memory? or send signals to each other?

Hi,

whatever others suggested, just use the Servlet Spec 2.3+ standard:

The webapp context scoped shared memory is here:

http://tomcat.apache.org/tomcat-5.5-doc/servletapi/javax/servlet/ServletContext.html#setAttribute(java.lang.String,%20java.lang.Object)
http://tomcat.apache.org/tomcat-5.5-doc/servletapi/javax/servlet/ServletContext.html#getAttribute(java.lang.String)

The event listener is here:

http://tomcat.apache.org/tomcat-5.5-doc/servletapi/javax/servlet/ServletContextAttributeListener.html

Singletons are evil, even more devilish for webapps. ;-)

Cheers,
Michael



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


Mime
View raw message