WebWork + SiteMesh using FreeMarker - available variables in decorators

Vítor Souza <[email protected]>
Newsgroups gmane.comp.web.sitemesh.general
Message-ID <14535701.1112821844217.JavaMail.os-j2ee@opensymphony01.contegix.com>
>  request.getLocale() ?
> That's where WebWork's ServeltDispatcher gets it.... 

In the FreeMarker template that is processed by the FreeMarker Result, this works: <#assign locale = Locale.getDefault() />, then ${locale}

request.getLocale() or request.locale doesn't work in the assign directive (InvalidReferenceException) nor using it directly in the interpolation (${request} issues "Expression request is undefined".


In the SiteMesh decorator, none of those work. "Expression Locale is undefined". I haven't investigated the source code yet to see why it works in the Result but not in the Decorator.


> You can also set it in the Session and let users set
> their Locale for the 
> rest of their session... Check out the
> I18nInterceptor. It's especially good 
> for testing :-)

I'll check out these possible solutions, but if there is a way to put the request in the FreeMarker context for the SiteMesh decorators, it would be a lot better, don't you think?

Thanks for your answer.

Vítor Souza

---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=1355&messageID=4195#4195


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.