You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by John Gardner <jo...@tagish.co.uk> on 2008/09/30 18:31:00 UTC
Multiple Time Zones on one Tomcat instance?
We currently have two webapps located on a single instance of Tomcat
5.5.25 for one of our International customers. The host OS is set as
GMT, and they are happy about this as users access the site from all
over the world. However, they want us to host another webapp
specifically for French users, and they want this to show French time.
Is there any way we can serve mutliple webapps from a single Tomcat
instance, with mutliple timezones?
Thanks in advance.
John
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Multiple Time Zones on one Tomcat instance?
Posted by John Gardner <jo...@tagish.co.uk>.
John5342 wrote:
> I am pretty sure there are jsp features to do this but if not it would be
> quite simple to create a new tag that checks the locale of the request and
> adjust the time returned to reflect the locale. Then just use that tag
> anywhere the time is needed.
>
Thanks John
It's what I suspected... the app developers should be coping with it, so
I'll pass it back to them.
Cheers
John
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Multiple Time Zones on one Tomcat instance?
Posted by John5342 <jo...@googlemail.com>.
I am pretty sure there are jsp features to do this but if not it would be
quite simple to create a new tag that checks the locale of the request and
adjust the time returned to reflect the locale. Then just use that tag
anywhere the time is needed.
2008/9/30 Caldarale, Charles R <Ch...@unisys.com>
> > From: John Gardner [mailto:john.gardner@tagish.co.uk]
> > Subject: Multiple Time Zones on one Tomcat instance?
> >
> > Is there any way we can serve mutliple webapps from a single Tomcat
> > instance, with mutliple timezones?
>
> Tomcat itself doesn't care about time zones, and a single JVM instance will
> only use one time zone at a time (no pun intended). You could run two
> instances of Tomcat, one for the French, and one for the less picky rest of
> the world. Other than that, you'd have to make the adjustments in the
> webapp itself to be cognizant of each client's time preference.
>
> - 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.
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
Re: Multiple Time Zones on one Tomcat instance?
Posted by André Warnier <aw...@ice-sa.com>.
John Gardner wrote:
> Caldarale, Charles R wrote:
>>> From: John Gardner [mailto:john.gardner@tagish.co.uk]
>>> Subject: Multiple Time Zones on one Tomcat instance?
>>>
>>> Is there any way we can serve mutliple webapps from a single Tomcat
>>> instance, with mutliple timezones?
>> Tomcat itself doesn't care about time zones, and a single JVM instance will only use one time zone at a time (no pun intended). You could run two instances of Tomcat, one for the French, and one for the less picky rest of the world. Other than that, you'd have to make the adjustments in the webapp itself to be cognizant of each client's time preference.
>>
>
>
> Thanks Charles
>
> So, using two instances of Tomcat on a single host OS would also involve
> installing two JVMs and each Tomcat instance using a different JVM?
>
> Would this be easy to do? I was always under the impression that you
> could only ever have one Tomcat running per machine at any one time due
> to the CATALINA_HOME env variable getting confused as to which instance
> of Tomcat it is actually using?
>
I think there is a bit of confusion between "installation/installed" and
"instance".
To express it in lay words :
Terms like "installation directory", CATALINA_HOME, JAVA_HOME relate to
the disk directory where that piece of software's *files* are installed.
For example, for Tomcat, CATALINA_HOME might be /usr/share/tomcat5.5
or C:/Tomcat5.5.
Under that directory, you would find subdirectories like "bin" or
"common" (where the actual Tomcat program files are located).
On the other hand, nothing stops you from running several "instances" of
these programs simultaneously, in parallel, each instance having its own
separate "run directory" and parameters.
This "run directory" for Tomcat is known as CATALINA_BASE.
You could for instance start two separate instances of Tomcat, which
would both use the program files located in CATALINA_HOME/bin, but
listen on different ports and use a different set of webapps.
In that case, the CATALINA_HOME of each instance would still be the same
(allowing them to find the programs to run), but their *CATALINA_BASE*
would be set differently; each of these Tomcat instances would look for
its own configuration files in CATALINA_BASE/conf and, by default, each
one would look in its own CATALINA_BASE/webapps directory for its webapps.
By default, there is only one instance of Tomcat running, and
CATALINA_BASE is, by default, the same as CATALINA_HOME.
But that ain't necessarily so.
The same happens with the JVM : you only need to install it once, no
matter how many separate instances you want to run. You should just
make sure that you start each instance with its own appropriate set of
parameters. In the case of the JVM, this is not done via environment
values such as CATALINA_HOME and CATALINA_BASE, but usually via "-D"
options on the java command-line.
Hope this helps.
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Multiple Time Zones on one Tomcat instance?
Posted by David kerber <dc...@verizon.net>.
John Gardner wrote:
> Caldarale, Charles R wrote:
>
>>> From: John Gardner [mailto:john.gardner@tagish.co.uk]
>>> Subject: Multiple Time Zones on one Tomcat instance?
>>>
>>> Is there any way we can serve mutliple webapps from a single Tomcat
>>> instance, with mutliple timezones?
>>>
>> Tomcat itself doesn't care about time zones, and a single JVM instance will only use one time zone at a time (no pun intended). You could run two instances of Tomcat, one for the French, and one for the less picky rest of the world. Other than that, you'd have to make the adjustments in the webapp itself to be cognizant of each client's time preference.
>>
>>
>
>
> Thanks Charles
>
> So, using two instances of Tomcat on a single host OS would also involve
> installing two JVMs and each Tomcat instance using a different JVM?
>
No. I've got 3 instances of tomcat each running its own app, with one
jvm installation. Takes lots of RAM, but works fine. You can set the
necessary env var's independently for each instance.
> Would this be easy to do? I was always under the impression that you
> could only ever have one Tomcat running per machine at any one time due
> to the CATALINA_HOME env variable getting confused as to which instance
> of Tomcat it is actually using?
>
> Thanks
>
> John
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>
>
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Multiple Time Zones on one Tomcat instance?
Posted by John Gardner <jo...@tagish.co.uk>.
Caldarale, Charles R wrote:
>> From: John Gardner [mailto:john.gardner@tagish.co.uk]
>> Subject: Multiple Time Zones on one Tomcat instance?
>>
>> Is there any way we can serve mutliple webapps from a single Tomcat
>> instance, with mutliple timezones?
>
> Tomcat itself doesn't care about time zones, and a single JVM instance will only use one time zone at a time (no pun intended). You could run two instances of Tomcat, one for the French, and one for the less picky rest of the world. Other than that, you'd have to make the adjustments in the webapp itself to be cognizant of each client's time preference.
>
Thanks Charles
So, using two instances of Tomcat on a single host OS would also involve
installing two JVMs and each Tomcat instance using a different JVM?
Would this be easy to do? I was always under the impression that you
could only ever have one Tomcat running per machine at any one time due
to the CATALINA_HOME env variable getting confused as to which instance
of Tomcat it is actually using?
Thanks
John
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: Multiple Time Zones on one Tomcat instance?
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: John Gardner [mailto:john.gardner@tagish.co.uk]
> Subject: Multiple Time Zones on one Tomcat instance?
>
> Is there any way we can serve mutliple webapps from a single Tomcat
> instance, with mutliple timezones?
Tomcat itself doesn't care about time zones, and a single JVM instance will only use one time zone at a time (no pun intended). You could run two instances of Tomcat, one for the French, and one for the less picky rest of the world. Other than that, you'd have to make the adjustments in the webapp itself to be cognizant of each client's time preference.
- 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.
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org