Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

get value from propertie file?

 
Weston Kornfeld
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 415
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic