Does JSP provide more flexibility then FreeMarker or is it other way around? My back-end involves Servlets. Which one is used under what circumstances?
License. Apache FreeMarker is Free software, licensed under the Apache License, Version 2.0.
Apache FreeMarker is a free Java-based template engine, originally focusing on dynamic web page generation with MVC software architecture. However, it is a general purpose template engine, with no dependency on servlets or HTTP or HTML, and is thus often used for generating source code, configuration files or e-mails.
Who uses Apache FreeMarker? 46 companies reportedly use Apache FreeMarker in their tech stacks, including CarGurus, Betfair, and Sodep.
Although FreeMarker has some programming capabilities, it is not a full-blown programming language like PHP. Instead, Java programs prepare the data to be displayed (like issue SQL queries), and FreeMarker just generates textual pages that display the prepared data using templates.
JSP is going to let you do more things in the view layer, so you might say that makes it more flexible. Things you probably shouldn't be doing though, which one could argue as a benefit for FreeMarker. It would afford you more control over what the view layer can do and force a better separation of concerns.
There's not really any right answer here. You can technically accomplish just about anything with either for your UI. Without more details about your project it's hard to make a recommendation. About the only thing I can say is that you should probably use the MVC pattern. It can be accomplished with either.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With