As usually happens after three hours of searching the web, finally breaking
down and asking the question, I ran across the answer and was able to find a
solution. So for anyone else out there that runs into this problem, this
won't work:
<input type="hidden" name="formToken" value="${Session.formToken}" />
but this will:
<input type="hidden" name="formToken" value="<@s.property
value='%{#session.formToken}'/>" />
Thanks.
(*Chris*)
On Tue, Jun 9, 2009 at 2:00 PM, Chris Pratt <[email protected]> wrote:
> I need to access a session variable from one of the FreeMarker Theme
> templates, and I can't seem to find the proper syntax. One site said to use
> ${Session.formToken}, but that seems to give me a lovely red on yellow error
> box across my display. I've also tried ${#session.formToken} thinking OGNL
> would take over, but that gives me:
>
> freemarker.core.ParseException: Token manager error:
> freemarker.core.TokenMgrError: Lexical error at line 1, column 50.
> Encountered: "#" (35), after : ""
>
> Is it possible to access the session attributes?
> (*Chris*)
>