Caldarale, Charles R wrote:
From: André Warnier [mailto:[EMAIL PROTECTED]
Subject: Re: Manager app language
In the Welcome page of this application (the one mentioned in the
web.xml's <welcome-file> tag), right before anything gets displayed to
the user calling it up, the user.language property is currently being
set to German
Sounds like we have a prime suspect. Can you post the portion of the JSP that
does that?
So we have a suspect. That would be good. But see further.
The code is here : http://dev.dev.wissensbank.com/public/index.jsp
Personally, I don't see anything in there that looks like it is setting
the global JVM user.language property.
But maybe the developer (to whom I told the story) has already updated
his app. I'll have to ask him.
Now my question is : assuming Tomcat is started anew, that all
applications are deployed and loaded
Are they? What is the value of deployOnStartup in your <Host> element(s)?
(The default value is true.)
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
So, true, apparently.
And I guess any init() method called by Tomcat would thus be
the one of this jsp compiler.
Correct.
But does that jsp compiler already pre-compile some of the pages, and
execute some of the methods invoked in these pages, even before a user
would actually call up the page ?
They don't have to be pre-compiled, just not modified since the last usage.
The JSP servlet saves the generated .java and .class files in Tomcat's work
directory and reuses them across Tomcat restarts. However, I can't find any
mechanism that will invoke the generated code prior to a request occurring.
Too bad then, I think we've just lost our prime suspect.
Since the manager servlets are not configured with <load-on-startup>, it looks
to me like any request for your main webapp that arrives before one for the manager
will trigger the observed behavior. There may be some subtleties in the Tomcat
initialization process that narrows the window, but I haven't dug into it enough to
see them.
Understand : it does not really bother me that much that the Manager
would come up either in German or English. That, we can live with.
It is the underlying reason that I would like to track down, because
that may tell us more about what to do and not to do in our webapps, or
what may be wrong in our current setup.
For example, the webapp above which set user.language by default is
something developed in-house. So now we know we should not do this, and
it's easy to fix.
Anyway, I have done a couple of tests :
1) if in the Tomcat startup scripts (*), I set
LC_CTYPE=en_GB.iso885915
and restart Tomcat, and call up the Manager page first, then the Manager
responds in English.
1) if in the Tomcat startup scripts, I set
[EMAIL PROTECTED]
then the Manager responds in German.
(*) (tomcat_dir)/bin/setenv.sh
In both cases, I also tried to call up the suspicious webapp first, and
to change its language, but in the current version of the webapp, this
did not influence the way the Manager responded afterward.
So, I have to conclude that either this webapp was modified between my
previous posts and now, or else that at some point in time the LC_CTYPE
in the startup scripts was set to German. That is something I have a
real difficulty imagining though, because as far as I know I am the only
one to touch these scripts, and I am quite sure that except today and
for the above tests, I never ever put a german locale in there.
And the system's default locale (in /etc/default/locale) is
# File generated by update-locale
LANG=en_US.ISO-8859-15
and was last modified in 2007.
The strange thing however is that the above locale does not appear when
I enter "locale -a | grep US" on that system. These appear :
en_US
en_US.iso88591
en_US.iso885915
en_US.utf8
Oh well, I guess some element of mystery must remain.
Thanks again for all the help.
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]