[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Internationalization (JSP)

Posted on 2003-11-20
6
Medium Priority
?
923 Views
Last Modified: 2006-11-17
Hi,

I'm testing the following code in order to internationalize my application:

---------------------------------------------------------------------
      Locale locale = new Locale("de");
      ResourceBundle resources;
      resources = ResourceBundle.getBundle("Messages", locale);
      System.out.print(resources.getString("settings_settings"));
---------------------------------------------------------------------

This works in standard Java applications.
- But when the code is put into a JSP, the error message says, the resource cannot be found.

(Messages_de.properties is in the same folder as test.java, resp., test.jsp. I'm using the NetBeans IDE.)

What's wrong?

- Thanks.
0
Comment
Question by:robbert
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 15

Expert Comment

by:jimmack
ID: 9791372
Just a guess, but you should be able to test it quickly enough.

Try putting the resource file in the WEB-INF directory of your web app.
0
 
LVL 35

Expert Comment

by:TimYates
ID: 9791932
If that doesn't work, maybe consider using the i18n taglib from apache?

http://jakarta.apache.org/taglibs/doc/i18n-doc/
0
 
LVL 14

Accepted Solution

by:
kennethxu earned 800 total points
ID: 9793261
>> Messages_de.properties is in the same folder as test.java, resp., test.jsp. I'm using the NetBeans IDE.)
I think it should be in WEB-INF/classes dir.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 15

Expert Comment

by:jimmack
ID: 9796025
Oh.  It's in the *classes* subdirectory.

Thanks kennethxu.  I was close with my guess ;-)
0
 
LVL 15

Author Comment

by:robbert
ID: 9799779
Thank you, that way, it works - and please excuse that I'm trying to extend the question:

Actually, the JSP (in the root web) calls a method of a class (in WEB-INFO/somefolder/internat.java), passing the name of the properties bundle as a parameter. - Where should I put the .properties file??
0
 
LVL 14

Expert Comment

by:kennethxu
ID: 9801191
It doesn't matter where you java SOURCE file is.
I assume you have your java class in WEB-INF/classes, then the properties file should still in the same place.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Working from home is a dream for many people who aren’t happy about getting up early, going to the office, and spending long hours at work. There are lots of benefits of remote work for employees.
As much as Microsoft wants to kill off PST file support, just as they tried to do with public folders, there are still times when it is useful or downright necessary to export Exchange mailboxes to PST files. Thankfully, it is still possible to e…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question