JSP uses freemaker to generate word documents based on word template
Using freemaker to generate word document based on word template
Introduction to freemaker
FreeMarker is a template engine written in Java language, which generates text output based on templates. FreeMarker has nothing to do with the web container, that is, when the web is running, it does not know servlet or http. It can not only be used as the implementation technology of presentation layer, but also be used to generate XML, JSP or Java.
Freemaker download address:
http://freemarker.incubator.apache.org/freemarkerdownload.html
Convert word template to FTL template
Find the word template file, use ${paramname} as the parameter name where replacement is needed [paramname is just an example], and save word as an XML file
Modify the XML file. After opening the XML file, you can see that our placeholder may
It will be separated by XML tags. We need to modify and delete the tags around the placeholder to make the parameter placeholder as a whole
Write project code
Reference address: http://blog.csdn.net/jackfrued/article/details/39449021