Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Internationalization

 
rs venky
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Sharang Thorat
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic