• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Freemarker Syntax for Accessing Messages in Resource Bundle

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic