1. jar packages that need to be imported
2. Exporting word and downloading is actually two-step.
The first step is to export (upload) the data that needs to be exported to the server
The second step is to download the documents on the server to the local
3.
The first step. Uploading documents
(1) Setting the response information and constructing the upload path
(2) Set the font style to create the object that generated the document
(3) Wordutils Tool Class
(4) Writing the document title
(5) The directory in which the document is written and the contents of the document are available in the tool class above. It's not glued to the picture, but keep in mind that after the document is finished, you call Us.closedocument (); The method is finished, otherwise the document content is empty.
(6) In fact, the difficulty lies in the document directory structure of the display, by the way before the code to stick, for reference (code sticky There is a repetition, a little messy, look at it. Because in the development environment of the code, not to take outside)
The second step. Download
Download will not say, and ordinary download the same, will not be able to find the Niang.
Java exporting Word documents with Itext