• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

New Variable in the Freemaker-Template-Model

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hallo, can anybody explain to me, how to set a new variable in the Freemaker-Template Data Model?

eg. there is a session-variable to get info about session-parameters.

I need to save a String to look up in several templates.

Thanks
Christian
[originally posted on jforum.net by Christian Schl�gel]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The FreeMaker template handler is called with a "context' object which is a SimpleHash object that maps variable names to objects. This is created in the jForum servlet and populated with "common" items.

Then it is passed to the specific action classes when they are created. The specific action methods can then add additional variables there.

Just look for references to the "context" object in the JForum code to see how this is done.


[originally posted on jforum.net by monroe]
 
rubbery bacon. rubbery tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic