• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Freemarker Syntax for Accessing Messages in Resource Bundle

 
R Rauser
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

I'm moving from JSPs to FTLs for presentation in a Struts 2 web app and I'm wondering how I can access messages in a resource bundle using Freemarker?

Basically I'm looking for a Freemarker equivalent to something like


where application.name is defined in my package.properties bundle sitting somewhere high up in my package hierarchy.

Thanks for any help!
 
uthaman udayakumar
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

you have to import the strtus tag library.. and embed the whole set of code inside (here the name is the resource bundle name) the code goes here
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The S2 tags area automatically imported; you should just be able to use:See the S2 FreeMarker docs for more info.

Note that there are some caveats when using the FM tags. FM tags are defined to be block or inline, and cannot be both (at least at this point, as far as I know). Some tags, like the "action" tag, are defined as an inline tag, disallowing the use of nested tags (like the "param" tag). For the most part this isn't an issue, but can be troublesome at times.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic