Re: freemarker w/ servlets -- access contextRoot

Daniel Dekany <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
Saturday, January 22, 2011, 6:47:26 PM, David Siefert wrote:

> Hi,
>
> I am wondering if there is any support for getting the contextRoot of
> a web application in a freemarker template processed by the Freemarker
> servlet?

That can't be answered in general because FreeMarker has no dependency
on Servlet-s or on HTTP at all; it just sees whatever was put into the
data-model and generates text, and that's it. So what is available for
the templates and how is completely up to the Web application
framework authors. Sure, there is a freemarker.ext.servlet package,
but that's just an extension (and I don't like that it's part of
freemarker.jar) and many web frameworks use their own solution instead
(and they should).

> Thanks,
> David

-- 
Best regards,
 Daniel Dekany


------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
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.