File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes Accessing property file from outside Application Context Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "Accessing property file from outside Application Context" Watch "Accessing property file from outside Application Context" New topic
Author

Accessing property file from outside Application Context

Ahmed Basheer
Ranch Hand

Joined: Apr 15, 2004
Posts: 77
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
sunil verma
Greenhorn

Joined: Apr 05, 2007
Posts: 6
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Accessing property file from outside Application Context
 
Similar Threads
Spring2.5.6+Tomcat7: HTTP Status 404: The requested resource () is not available
No Context configured to process error
BeanDefinitionStoreException
Question 60 - Final mock exam HFSJ
No Context configured to process Error