Thursday January 17, 2008

FreeMarker vs. JSP 2 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:
- It's expression language allows methods to be called with arguments.
- Templates can be loaded from a JAR on a remote server.
- 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. Here's some problems that I see with using it:
- No XML escaping of expressions by default
- No compile-time checking of expressions
- IDE support is limited to Eclipse (meaning very little in the way of code-completion)
FreeMarker users - are there other problems you've experienced when using FreeMarker in your applications? Posted in Java at Jan 17 2008, 12:37:12 PM MST 11 Comments
Search This Site
Recent Entries
- C++, Java and .NET: Lessons Learned from the Internet Age
- Highly Interactive Software with Java and Flex
- The Cloud Computing Continuum with Bob McWhirter
- Software Quality: The Quest for the Holy Grail?
- What's Happening in the Java World?
- Fantastic Fun in Jackson Hole
- How We Hired a Team of 10 in 2 Months
- Jack's Skiing Like A Madman!
- My Future of Web Frameworks Presentation
- My Guest Room Remodel is finished!