File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes get value from propertie file? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "get value from propertie file?" Watch "get value from propertie file?" New topic
Author

get value from propertie file?

Weston Kornfeld
Greenhorn

Joined: Mar 01, 2005
Posts: 28
Hi,

How do I get a value out of a property file (name=value) from inside a jsp. I am using struts as well?

Many Thanks
sreenath reddy
Ranch Hand

Joined: Sep 21, 2003
Posts: 415
There is no inbuilt thing as such in struts for doing that .but you always have an option of placing the same key and value in the ApplicationResources.properties and then read it using the bean:message tag .but it all depends on where you need to place that resource
sudin prans
Greenhorn

Joined: Sep 02, 2005
Posts: 4
For example in a web application ,I can have the property file ApplicationResources.properties in which I can have the pair,page.title=Home,which I can retrieve in my .jsp as <bean:message key="page.title"/>.
But for this,I should have the entry <message-resources parameter="ApplicationResources" /> in my struts-config.xml.

Hope this would help.Pls try.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: get value from propertie file?
 
Similar Threads
How to pass value from .java to .jsp in struts.
writing to files
Connection to MySql Database
how to write the hashtable to a file
How do i get the pagesize value in the display tag from the properties file.