Freemarker in Java app server, best practices

Chris <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
I currently use JSP, and am trying to migrate to Freemarker. In my JSP 
pages I normally have a backing Java class, one per page, and just 
instantiate it at the top of the page. I then call page.getThis() and 
.getThat() lower down in the page.

I'm not quite sure how to get the same functionality in Freemarker. I 
could create a custom servlet for each .ftl page and then map one to the 
other in web.xml, but that seems like a waste. I'd rather be able to 
specify the appropriate servlet class right at the top of the ftl page, 
and then I won't have to add anything to web.xml.

What's the best way to do this?



------------------------------------------------------------------------------
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.