You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Tay, William" <Wi...@usa.xerox.com> on 2003/04/09 22:49:34 UTC

Problem using resource bundle in servlet on Tomcat 4.1.24 using j 2sdk1.4.1

Hi,
 
I am developing a Web servlet application using Tomcat 4.1.24 and
j2sdk1.4.1. There are problems with using resource bundle in a servlet,
which is called by another servlet. The code for using resource bundle is as
follow:
... 
String language = httpservletrequest.getParameter("lang");
Locale locale = new Locale(language);
IdResources = ResourceBundle.getBundle("IdRes", locale);    // where IdRes
is the base name of property resource bundles
...
 
The resource bundles, e.g. IdRes_it.properties, IdRes_zh.properties, etc.
are located in the same directory as the servlets, which are .class files.
 
The MissingResourceException exception got thrown when the servlet runs.
 
My CLASSPATH setting is
.:/usr/local/j2sdk1.4.1/lib:${JDBC_HOME}/mysql-connector-java-3.0.5-gamma-bi
n.jar:/usr/local/jakarta-tomcat-4.1.24/common/lib/servlet.jar

The weird thing is the resource bundle code works with Tomcat 3.2.3 and
jdk1.3.1.
 
Please advice. Thanks.
 
Will