Why use Web-static technology?
Provides concurrent hosting for some sites that have a huge amount of instantaneous access to reduce database pressure. It has a common denominator with cache technology to alleviate the database's access pressure but uses different scenarios. Caching is better suited to small-scale data, and Web pages are statically adapted to large-scale and relatively infrequently variable data. At the same time it facilitates the use of SEO: For example, in the e-Commerce Product Details page or in, the media article reports.
Getting Started with: 1. Add Freemarker related documentation plugin to eclipse
2. Import related dependencies in the project
3. Creating a template file
Template Four elements: text, annotations, interpolation, FTL instructions
Create:
1. Create config class configuration
configuration=new configuration (Configuration.getversion ());//getversion get the latest version to avoid hints out of date
//2. Set the directory where the template resides
configuration.setdirectoryfortemplateloading ("d:***");
3. Setting the character set
configuration.setdefaultencoding ("Utf-8");
4. Load templates Template
= Configuration.gettemplate ("TEST.FTL");
5. Create a data Model
Map map=new HashMap ();
Map.put ("name", "Civet cat");
Map.put ("message", "shovel a great lump of excrement");
6. Create writer Object
writer out =new FileWriter ("d:*****");
7. Output
template.process (map, out);
8. Close Writer Object
out.close ();
detailed label and use command reference: http://blog.csdn.net/fhx007/article/details/7902040/