Re: Accessing Portlet Session parameters in Freemarker
Daniel Dekany <[email protected]>
| Newsgroups | gmane.comp.web.freemarker.user |
|---|---|
| Message-ID | <[email protected]> |
You should ask the Spring guys... it's up to the Web Application
Framework, FreeMarker gives total control to it.
BTW, as the error message says "Expression Session.productType is
undefined", not "Expression Session is undefined", it appears at least
Session exists. It's *maybe* possible to print the keys in it as:
<ul>
<#list Session?keys as key>
<li>${key}</li>
</#list>
</ul>
Tuesday, April 8, 2008, 10:35:20 PM, sunil wrote:
> Hi,
> Iam developing a Spring Portlet application with Freemarker as the view.
>
> As part of my application I have to add some attributes in Portlet Session and
> access those in the Freemarker template files.
>
> currently when I try to access the values in the values in the template files
> Iam getting the InvalidReference Exception.
>
> I tried accessing the Session parameter values like below.
>
> ${Session.productType}
>
> and I got the below exception.
>
> ***********************
> Expression Session.productType is undefined on line 9, column 3 in login.ftl.
> The problematic instruction:
> ----------
==>> ${Session.productType} [on line 9, column 1 in login.ftl]
> ----------
>
> Java backtrace for programmers:
> ----------
> freemarker.core.InvalidReferenceException: Expression Session.productType is
> undefined on line 9, column 3 in login.ftl.
> ***********************
>
>
> can any one please let me know how to access Portlet Session parameters in
> Freemaker template files.
>
>
> Thanks,
> Sunil.
--
Best regards,
Daniel Dekany
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone