aspose file tools*
The moose likes Servlets and the fly likes Internationalization Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Internationalization" Watch "Internationalization" New topic
Author

Internationalization

rs venky
Greenhorn

Joined: Dec 25, 2000
Posts: 4
Following is my JSP code:
<%@page import =" java.util.*" %>
<%!
String language;
String country;
%>
<%
try
{
language = new String("fr");
country = new String("FR");
Locale currentLocale;
ResourceBundle messages;
currentLocale = new Locale(language, country);
messages = ResourceBundle.getBundle("MessagesBundle",currentLocale);


out.println(messages.getString("greetings"));
out.println(messages.getString("inquiry"));
out.println(messages.getString("farewell"));
}catch (Exception e) {out.println(e);}

%>
<html>
<body>
<h2>Kumar</h2>
</body>
</html>
If i try executing the page in IE i am getting following error and one more thing is all the resource bundle files are residing in the directory.
Error :
java.util.MissingResourceException: can't find resource for MessagesBundle_fr_FR
Any one can suggest how it has to be done.
Thanks
Venky

venky
Sharang Thorat
Greenhorn

Joined: Dec 07, 2000
Posts: 21
Hi
if properties file are in the classpath then you will not
get exception.
In case you r using tomcat keep properties file in already
set classpath or change it.
regards
sharang
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Internationalization