Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

display value from resources file on jsp with struts tags?

 
Liz Brown
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if i have a table name defined in my resources file. How to display it on jsp with the struts tags-html/bean/etc
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use <bean:message/>
 
Liz Brown
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
could you please send me an example or link which shows how to use this tag with Resources file
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you have the following property in your ApplicationResources.properties file:

then the following tag should read the "foo.bar.FrontPageTitle" property and print it on the web page:


The ApplicationResources file must be somewhere on the classpath in order for Struts to find it. If, for example, you've deployed it at "WEB-INF/classes/ApplicationResources.properties", you need to specify the following in your struts-config.xml:

If you've deployed the file under a package structure, e.g. "WEB-INF/classes/com/company/foo/ApplicationResources.properties", then you need to reflect the location in your struts-config.xml accordingly:


Does that help?
 
Liz Brown
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic