Re: freemarker w/ servlets -- access contextRoot
David Siefert <[email protected]>
| Newsgroups | gmane.comp.web.freemarker.user |
|---|---|
| Message-ID | <[email protected]> |
Cool. So should the community (includes myself) move the freemarker.ext.servlet stuff into a separate project? I've already had to modify the servlet to support an alternate template loader class, so I think it would be a worthwhile contribution. Would it also be worth having the servlet automatically include in the data-model some of the servlet request properties (just like Request, Session, Application implicit objects get added)? Thanks, David 2011/1/22 Daniel Dekany <[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