In the Java field, there are three main performance layer technologies: JSP, Freemarker, Velocity.
JSP is the most familiar technology of everyone
Advantages:
1. Powerful function, can write Java code
2. Support JSP tag (JSP tag)
3. Support Expression language (EL)
4, the official standard, a wide range of users, a wealth of third-party JSP Tag Library
5, good performance. JSP compiled into class file execution, good performance
Disadvantages:
JSP has no obvious shortcomings, it is not to pick a bone that is, because you can write Java code, such as improper use easily destroy the MVC structure.
Velocity is a template language that appears earlier to replace JSP
Advantages:
1. Cannot write Java code, can achieve strict MVC separation
2, good performance, is said to be better than JSP performance
3, using the expression language, it is said that the expression of JSP language is learning velocity
Disadvantages:
1. Not the official standard
2, user groups and third-party tag libraries do not have more JSP.
3, the JSP tag support is not good enough
Freemarker
Advantages:
1. Cannot write Java code, can achieve strict MVC separation
2, the performance is very good
3. Good support for JSP tags
4, built in a lot of common functions, easy to use
5, macro definition (like JSP tags) very convenient
6. Using an expression language
Disadvantages:
1. Not the official standard
2, user groups and third-party tag libraries do not have more JSP
Reasons to choose Freemarker:
1, performance. Velocity should be the best, followed by the JSP, and the average page Freemarker performance is the worst (albeit just a few milliseconds to more than 10 milliseconds gap). But on pages with complex pages (with a lot of judgment and date amounts formatted), Freemarker performance is better than using tag and El jsp.
2, macro definition is more convenient than JSP tag
3, built-in a lot of common functions. such as HTML filtering, date amount formatting and so on, very convenient to use
4. Support JSP Tag
5. Strict MVC separation can be achieved
Why to use Freemarker