tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Kjome <>
Subject Re: 'Global' scope for sharing beans across all webapps?
Date Tue, 07 May 2002 21:13:26 GMT
Hello Joel,

There is an option in the Server.xml <Context> tag that allows for
something like this:

<Context crossContext="true">
Set to true if you want calls within this application to ServletContext.getContext() to successfully
return a request dispatcher for other web applications running on this virtual host. Set to
false (the default) in security conscious environments, to make getContext() always return

You can also put classes and libs in $TOMCAT_HOME/lib or
$TOMCAT_HOME/common/lib or $TOMCAT_HOME/classes or
$TOMCAT_HOME/common/classes in order to allow all webapps access to
any particular class.  You should be able to initialize or reset
static vars in that class from any context and the other contexts will
be able to get that same value.


Tuesday, May 07, 2002, 3:13:15 PM, you wrote:

JB> Hi there,

JB> I understand scoping as far as request, session and application (ie: web
JB> application) scoping is concerned.
JB> However, I have several web applications that make up the over-all website I
JB> am currently working on and want a global bean (to hold configuration
JB> information) to have one instance to be accessed by all webapps for one
JB> virtual host - ie: all <context>'s in a a <host> (server.xml)

JB> I have searched and searched and can't seem to find anything on this.

JB> Any help would be greatly appreciated.

JB> tia,

JB> Joel Baker.

JB> --
JB> To unsubscribe, e-mail:   <>
JB> For additional commands, e-mail: <>

Best regards,

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message