This week's book giveaway is in the Web Services forum.
We're giving away four copies of Microservices in Action and have Morgan Bruce & Paulo A. Pereira on-line!
See this thread for details.
Win a copy of Microservices in Action this week in the Web Services 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
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

Accessing property file from outside Application Context  RSS feed

 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a property file stored somewhere on disk say c:\tmp\file.properties. This property file contains name value strings e.g
version=6.0 etc.. I need to access this file from JSF page and access the values of the given names(key's).This property file is not localized. I can not use <f:loadbundle basename....> because basename only loads the file which are in the web application context, that is basename point to property file under WEB-INF/classes only, but my property file is outside application context and infact it is under c:\tmp. Is there any easier way to access this file and access its contents as name/value pairs.

Help Appreciated.
-Basheer
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i think you can use core java api for accesing the property file. try to access the property file within the constructor of the bean and than try to set the values of the components.

But why do you want to put the it outside the application context does it have any advantage.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!