cancel
Showing results for 
Search instead for 
Did you mean: 

Resource bundle in JSP file

Former Member
0 Kudos

hi

i have created a WAR project with a JSP file. in it i am referring to a resource bundle using the code..

********************************************

Locale lo = Locale.ENGLISH;

ResourceBundle bun = ResourceBundle.getBundle("BundleName",lo);

*****************************************************

After deployment , when i call this page, i am getting exception like this..

java.util.MissingResourceException: Can't find bundle for base name BundleName, locale en

at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:839)

at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:729)

at java.util.ResourceBundle.getBundle(ResourceBundle.java:579)

i think its because of the problem in the look up of the resource bundle..

My jsp file is in the webContent folder and i put the Message_en.properties file in the same directory, and in the WEB-INF folder ..

Where should i put this resource bundle files?.

regards

Kishor

Accepted Solutions (0)

Answers (2)

Answers (2)

kishorg
Advisor
Advisor
0 Kudos

Hi Maksim Rashchynski,

thanks for your reply .

i could resolve the problem by putting those resource bundle files in the source directory of the project(

and also by keeping that resource bundle files in one package and look up for that files with their package structure .)

i mean..

if my resorce bundle files are in com.exm.* package,

just give com.exm.<Resource Bundle name> in place of the look up string .

Regards

Kishor Gopinathan

former_member182372
Active Contributor
0 Kudos

Hello Kishor,

You a calling "BundleName" but having Message_en.properties. Call "Message" instead:

Locale lo = Locale.ENGLISH;
ResourceBundle bun = ResourceBundle.getBundle("Message",lo);

Best regards, Maksim Rashchynski.