Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • 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:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!