• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

ResourceBundle use in Web application

 
Ranch Hand
Posts: 264
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Everybody,

I am going to write I18N code in my jsp based application. Here i will use a custom tag like bean:message. I want to load properties bundle using ResourceBundle.

I just want to know which is the place in web application
1. in root
2. under /WEB-INF/classes
3. or undeer /WEB-INF/classes/com/...so where in classes level.

Which consructor of ResourceBundle i should use if i have my properties file under /WEB-INF/resources/MyBundle_en_US.properties

Please help me to sort out this issue. Is there any use of ClassLoader here.
 
Sheriff
Posts: 67753
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since you will be using a proprietary Struts tag in place of the standardized JSTL tags, this has been moved to the Struts forum.
 
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you want to use the /WEB-INF/classes directory (a directory on the classpath). If your file is:
/WEB-INF/classes/resources/MyBundle_en_US.properties

Your could should be:
ResourceBundle bundle = ResourceBundle.getBundle("resources.MyBundle_en_US");

- Brent
 
Well THAT's new! Comfort me, reliable tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic