Desired Features in FreeMarker
mraible <[email protected]>
| Newsgroups | gmane.comp.web.freemarker.user |
|---|---|
| Message-ID | <[email protected]> |
I've been doing quite a bit of prototyping with Spring MVC and Struts 2 with both JSP and FreeMarker in the last few months. I'm trying to migrate a proprietary servlet-based framework with a proprietary JSP compiler to something that's open source. There's a couple of important features that the proprietary view framework has: 1. It's expression language allows methods to be called with arguments. 2. Templates can be loaded from a JAR on a remote server. 3. XML in variables is escaped by default. For #1, I've found this to be impossible with JSP EL or JSTL. I've created JSP functions that allow argument passing, but they don't allow overloading of functions. FreeMarker solves #1. For #2, JSPs again fail because the templates have to be on the file system or in a WAR. FreeMarker solves this problem as well. For #3, neither JSP or FreeMarker solve this problem. I realize it can be fixed in FreeMarker by hacking the code - I've done the same with Tomcat and solved it for JSP as well. So based on the requirements in this project, FreeMarker is the clear winner. However, there's a couple of questions I have. 1. When doing the JSP-based prototype with Struts 2, I was able to use JSP 2.0 tag files to develop a <foo:body> tag that allows content to be added around the body of the page. Does FreeMarker offer something similar, or is it something like SiteMesh the only solution? 2. Is it possible to add static imports/methods to a context so "url(foo).q(bar)" can be used instead of referring to the object that contains the methods - "urlBuilder.url(foo).q(bar)"? 3. Is it possible to change how HTML is parsed so you can override or customize the tag? The current compiler does this and it allows more fine-grained control over template processing without requiring new macros to be called. Thanks for any information you can provide. Matt -- View this message in context: http://www.nabble.com/Desired-Features-in-FreeMarker-tp14927925p14927925.html Sent from the freemarker-user mailing list archive at Nabble.com. ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/