FreeMarker application scenarios

 
FreeMarker is a template engine : that is, a template-based and data to be changed, and used to generate output text ( HTML web pages, e-mail , configuration files , source code , etc.) of common tools. It is not for end users, but a Java class library , is a programmer can embed components of their product development.

 

Officially, the use of FreeMarker achieve separation of logic and view,

FreeMarker is different from the JSP place.
FreeMarker template support, it can dynamically adjust the view, without changing the business logic.
 Yes, JSP really can do templated. But the JSP itself does not support templating, if you want to do FreeMarker templates, and probably have a lot of development effort.
Some people may say: If you want to change the user interface, write JSP code sets for users to choose not to all?
Yes, this does also support the templated to some extent. But this template must write code, compile, and then release. The very important point is that given the FreeMarker define a new view, do not need to write code, no fat version, only need to define a new template.
So conclude, FreeMarker used under similar Taobao shop merchandise display scene, will be more convenient than JSP.
Because users want to put products on Taobao's booth, display of goods will change frequently, sometimes have to do something to beautify the UI, adjust the content placement, and so on. In this case, only you need to use a new template, you can change the UI. Without the need to Taobao platform code changes.
In this case, the JSP will not have much advantage.

 

Guess you like

Origin www.cnblogs.com/jing1617/p/11516799.html