This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes JSP and the fly likes internationalization help! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "internationalization help!" Watch "internationalization help!" New topic
Author

internationalization help!

Neeraj Macker
Ranch Hand

Joined: Nov 10, 2004
Posts: 77
its so simple but i get java.util.MissingResourceException...why?

my code:
----------------------------

import java.util.*;

Locale currentLocale;
ResourceBundle messages;

currentLocale = new Locale("de");
messages = ResourceBundle.getBundle("MessagesBundle",currentLocale);
System.out.println(messages.getString("greetings"));

the name of my file is MessagesBundle_de.properties

i have adapted the above code for a JSP.thats all. the properties file is in the same directory as is the JSP. why am i getting the exception?
David Ulicny
Ranch Hand

Joined: Aug 04, 2004
Posts: 724
Put the properties file in classes directory.


SCJP<br />SCWCD <br />ICSD(286)<br />MCP 70-216
Neeraj Macker
Ranch Hand

Joined: Nov 10, 2004
Posts: 77
Originally posted by David Ulicny:
Put the properties file in classes directory.


thanks a million,,this forum rocks...as if i call up my best friend and get help immediately.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: internationalization help!
 
Similar Threads
ResourceBundle.getBundle
ResourceBundles & its properties files
using two properties files in struts
Help with I18N
getting Properties file in MessageBundle