Re: Freemarker in Java app server, best practices

Brian Pontarelli <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
> There are solutions for everything, only you have to find or implement
> it... Like, if you find that many views has common actions, then maybe
> you are going towards a CMS-like system. And Java CMS-es exist, some
> even uses FreeMarker (like Magnolia), but surely you don't address the
> templates in the URL-s directly. There are many many approaches to all
> this, building dynamic Web sites. No wonder there are like infinite
> number of Web Application Frameworks and CMS-es around, and according
> their authors all is the best... ;) for what they did when they
> created the framework. There is no FM-specific best practice that
> applies to the framework architecture. Of course, FM templates should
> only be used for strictly presentation-related tasks, because that's
> what it's for. But FM doesn't dictate your framework architecture,
> it's just a component. (Similarly JSP doesn't (strictly...) dictate a
> framework architecture, although it's much more intrusive than FM.) So
> find out what you want without considering FM, and if you find that
> you need a template engine in your architecture, FM most certainly
> won't be in your way. You don't even need to do messy hacks as forward
> HTTP request to it (like you do in JSP model 2), as its functionality
> is primarily available through its public Java API. And it doesn't
> even expects to have a Servlet environment...

This is how we use FM in JCatapult instead of JSP. It also allows us  
to unit test everything, including the view execution. The closest  
anyone I know has come to that is a few folks tinkering with the  
Jasper compiler stand-alone. Still not ideal at all.

-bp


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
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.