wood burning stoves 2.0*
The moose likes Struts and the fly likes Message Resource FIle - Get Value Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Message Resource FIle - Get Value" Watch "Message Resource FIle - Get Value" New topic
Author

Message Resource FIle - Get Value

ankit maini
Greenhorn

Joined: Feb 08, 2011
Posts: 25

I am using struts 1.1.
In my project i have one message-resources file called ApplicationResource.properties . Now i want to get the value of a key say my database password and username from this properties file in normal java class in my project. How can i do this. Please explain.

Thanks in Advance
ankit maini
Greenhorn

Joined: Feb 08, 2011
Posts: 25

Please reply as soon as possible.
rohit chavan
Ranch Hand

Joined: Oct 08, 2010
Posts: 131

Hi,

Hope you would have got the solution by now.

here is a code snippet which can be used for reading properties file in a web application.

ankit maini
Greenhorn

Joined: Feb 08, 2011
Posts: 25

@rohit chavan

Thanks
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Message Resource FIle - Get Value
 
Similar Threads
Properties file - keeping comments after modifying the the value
Intellij - implementation instead of declaration
getResource for getting a file located on a different project
can i assign an error message for validation annotation from a .properties file
configuration file path