aspose file tools*
The moose likes Struts and the fly likes how to write properties file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how to write properties file" Watch "how to write properties file" New topic
Author

how to write properties file

santhoshkumar samala
Ranch Hand

Joined: Nov 12, 2003
Posts: 156

hi

generally when we see log4j or hibernate and also in struts framework we have ".properties" file and we mention key value pairs in that properties file. but what If I want to write my own ".properties" file say dbconnection.properties, then how to read it from a java file.I am not getting any Idea, I know if we mention the database connection etc in xml file the parsers will help, but how can we read a ".properties" file? how is it possible in struts framework? because it has "applicationresources.properties" file

thanks in advance


santhosh<br />SCJP,SCWCD
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

In Struts, from your Action classes you can call:
getResources(request)
and will return a MessageResources object created from the ApplicationResources.properties file.


A good workman is known by his tools.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to write properties file