I didnt have to change any freemarker web.xml stuff ...
First of, please note that not under all circustances all attributes of an object will be filled. I noticed that with some user objects priorly. You can find out fast when debugging.
What I did for instance was checking which group(s) a user was part of, and - depending on if he was staff member, the user would see a different set of "bb" entries in the edit box... which would allow him to write "Knowledgebase" styled articles.
Each page has a different template attribute which will be filled in the specific object. There you can set the attribute which you can read on the template file then. There wasnt much more that I had to do.
I guess the 'flaw' in your approach could be that you edit the 'session' object. You have to edit some template session object - which as mentioned above - is specific for each template file. Which is why each template page may have different attributes as readable. If you put the variable into the session only, make sure that the session object is being read by the page already (to make sure it's available) and then just use the session.getAttribute("... ") as
string.
[originally posted on jforum.net by Sid]