Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
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 Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how to write properties file" Watch "how to write properties file" New topic

how to write properties file

santhoshkumar samala
Ranch Hand

Joined: Nov 12, 2003
Posts: 156


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, 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 "" file

thanks in advance

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

Joined: Feb 05, 2003
Posts: 4727

In Struts, from your Action classes you can call:
and will return a MessageResources object created from the file.

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