JSP uses freemarker to generate word documents based on the word template, jspfreemarker
Use freemarker to generate word Documents Based on word Templates
Freemarker Introduction
FreeMarker is a Java template engine that generates text output based on the template. 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 the presentation layer, but also be used to generate XML, JSP or Java.
Freemarker:
Http://freemarker.incubator.apache.org/freemarkerdownload.html
Word template to ftl Template
Find the word template file, use $ {paramName} as the parameter name [paramName is just an example], and save word as an xml file
Modify the xml file. After opening the xml file, we can see the possible placeholders.
Will be separated by xml tags. We need to modify it to delete the tags around the placeholder so that the parameter placeholder can be used as a whole.
Compile project code
4. Controller call code
Reference: http://blog.csdn.net/jackfrued/article/details/39449021