Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

properties file using the ResourceBundle class?

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do I access the values from a properties file using the ResourceBundle class?
Currently I have this properties file under \WEB-INF\classes and it works fine using the code

'ResourceBundle resourceBundle = ResourceBundle.getBundle("emailParameters");'

where "emailParameters.properties" is the name of the properties file.

I need to have the properties file outside the WEB-INF. I need to place it somewhere in the C:\.
How do I access this file using the ResourceBundle class?

[edit:removed color]


 
Ranch Hand
Posts: 1512
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not a good idea to try to access a local drive from a web application. No guarantee the drive will exist.
 
Ranjith Jain
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok....
but can i place tht file under classpath.
Any help would be appreciated
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Youp you can add the property file in the classpath.

Can i know are you using it into the web application with spring or another java standalone program
 
Marshal
Posts: 67429
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have removed the red color from your posts. Please use color sparingly and only for emphasis.
 
Ranjith Jain
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok
How will access that file if i use getBundle method from ResourceBundle class
I am not using any framework.Just a core Java code
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic