Edit files (read/edit/save) in java based web application via webdav

。_饼干妹妹 提交于 2019-12-09 23:13:48

问题


im searching for informations how to implement a service in our servlet based java web application which can handle online editing (reading / editing / saving) of some common file types like the programs of the office suite via webdav. We have a tomcat 7 running and using webdav already for mounting folders on client computers (implemented by an colleague) which works fine. Now im having the request to research ways to implement this online editing features (for example open a .doc file in our webapp, edit the file in word and save it automaticly in our webapp) and couldn't find that many informations/howtos about this topic.

From what i could find so far i could see that using this webdav feature some response header values needs to be set and a own servlet needs to be implemented. But im still not sure where to start and if im right... Does anybody knows any good resoures for this? (documentations, simple webapp example, ...whatever)?


回答1:


You should use Milton, its intended for exactly the purpose you describe. Its pretty simple to implement, you create annotatated methods which make the information in your web application available via webdav. This includes file and folder browsing, as well as uploading, downloading and locking (required for MS Office)

There are tutorials on the milton website which guide you through the implementation process.

Here's a simple hello world implementation from the first tutorial: https://github.com/miltonio/milton2/blob/master/examples/tuts-anno1/src/main/java/com/helloworld/HelloWorldController.java

Milton comes with a free community edition which supports DAV level 1 only. That will work with most 3rd party webdav clients like Bitkinex, Cyberduck, etc. But for compatibility with operating system webdav clients, including Win7, MacOS, MS Office, you need the enterprise edition which is available on a commercial license.

Please see the milton site for details - http://milton.io

(I'm the author)



来源:https://stackoverflow.com/questions/19949593/edit-files-read-edit-save-in-java-based-web-application-via-webdav

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!