method/step
-
Download the third-party plug-in development kit whose logo is the "P" icon: Baidu click PageOffice, download from the official website
-
Take Myeclipse as an example, create a new Web Project, such as: wordonline
-
Unzip the development package, copy the jar package in the "integration file\lib" directory to the "WEB-INF\lib" directory of your own project
-
Referring to the "integration file\web.xml" file, copy the relevant configuration inside to the web.xml of your own project
-
Create a new doc directory and test file test.doc; create a new page word.jsp, and write code to open the file online
-
Run the project and visit the word.jsp page; enter the trial serial number provided in the development kit when prompted to register
-
After the registration is successful, the file will be opened online (Note: Only IE or IE kernel browsers, or browsers of Chrome 41 and below are supported at this time)
-
Create a new page SaveFile.jsp that handles file saving (using the action method or RequestMapping method under the framework), and call the FileSaver object to save the file.
-
Revisit word.jsp, open the edited file, and click the save button to save the file. (Note: Not all browsers are supported at this time)
-
Add js code to the index.jsp page to call the relevant .js file; add a button to call the POBrowser.openWindowModeless method to open word.jsp, which supports all browsers to open, edit and save word files online